Skip to content

Commit

Permalink
feat: added support for bucket-name-suffix in fscloud and bucket modu…
Browse files Browse the repository at this point in the history
…le (#550)

Co-authored-by: Conall Ó Cofaigh <[email protected]>
  • Loading branch information
Ak-sky and ocofaigh authored Mar 8, 2024
1 parent a79721c commit f00db98
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/buckets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ No resources.

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_bucket_configs"></a> [bucket\_configs](#input\_bucket\_configs) | Cloud Object Storage bucket configurations | <pre>list(object({<br> access_tags = optional(list(string), [])<br> bucket_name = string<br> kms_encryption_enabled = optional(bool, true)<br> kms_guid = optional(string, null)<br> kms_key_crn = optional(string, null)<br> skip_iam_authorization_policy = optional(bool, false)<br> management_endpoint_type = optional(string, "public")<br> cross_region_location = optional(string, null)<br> storage_class = optional(string, "smart")<br> region_location = optional(string, null)<br> resource_instance_id = string<br> force_delete = optional(bool, true)<br> single_site_location = optional(string, null)<br> hard_quota = optional(number, null)<br><br> activity_tracking = optional(object({<br> read_data_events = optional(bool, true)<br> write_data_events = optional(bool, true)<br> activity_tracker_crn = optional(string, null)<br> }))<br> archive_rule = optional(object({<br> enable = optional(bool, false)<br> days = optional(number, 20)<br> type = optional(string, "Glacier")<br> }))<br> expire_rule = optional(object({<br> enable = optional(bool, false)<br> days = optional(number, 365)<br> }))<br> metrics_monitoring = optional(object({<br> usage_metrics_enabled = optional(bool, true)<br> request_metrics_enabled = optional(bool, true)<br> metrics_monitoring_crn = optional(string, null)<br> }))<br> object_versioning = optional(object({<br> enable = optional(bool, false)<br> }))<br> retention_rule = optional(object({<br> default = optional(number, 90)<br> maximum = optional(number, 350)<br> minimum = optional(number, 90)<br> permanent = optional(bool, false)<br> }))<br> cbr_rules = optional(list(object({<br> description = string<br> account_id = string<br> rule_contexts = list(object({<br> attributes = optional(list(object({<br> name = string<br> value = string<br> }))) }))<br> enforcement_mode = string<br> tags = optional(list(object({<br> name = string<br> value = string<br> })), [])<br> operations = optional(list(object({<br> api_types = list(object({<br> api_type_id = string<br> }))<br> })))<br> })), [])<br><br> }))</pre> | n/a | yes |
| <a name="input_bucket_configs"></a> [bucket\_configs](#input\_bucket\_configs) | Cloud Object Storage bucket configurations | <pre>list(object({<br> access_tags = optional(list(string), [])<br> add_bucket_name_suffix = optional(bool, false)<br> bucket_name = string<br> kms_encryption_enabled = optional(bool, true)<br> kms_guid = optional(string, null)<br> kms_key_crn = optional(string, null)<br> skip_iam_authorization_policy = optional(bool, false)<br> management_endpoint_type = optional(string, "public")<br> cross_region_location = optional(string, null)<br> storage_class = optional(string, "smart")<br> region_location = optional(string, null)<br> resource_instance_id = string<br> force_delete = optional(bool, true)<br> single_site_location = optional(string, null)<br> hard_quota = optional(number, null)<br><br> activity_tracking = optional(object({<br> read_data_events = optional(bool, true)<br> write_data_events = optional(bool, true)<br> activity_tracker_crn = optional(string, null)<br> }))<br> archive_rule = optional(object({<br> enable = optional(bool, false)<br> days = optional(number, 20)<br> type = optional(string, "Glacier")<br> }))<br> expire_rule = optional(object({<br> enable = optional(bool, false)<br> days = optional(number, 365)<br> }))<br> metrics_monitoring = optional(object({<br> usage_metrics_enabled = optional(bool, true)<br> request_metrics_enabled = optional(bool, true)<br> metrics_monitoring_crn = optional(string, null)<br> }))<br> object_versioning = optional(object({<br> enable = optional(bool, false)<br> }))<br> retention_rule = optional(object({<br> default = optional(number, 90)<br> maximum = optional(number, 350)<br> minimum = optional(number, 90)<br> permanent = optional(bool, false)<br> }))<br> cbr_rules = optional(list(object({<br> description = string<br> account_id = string<br> rule_contexts = list(object({<br> attributes = optional(list(object({<br> name = string<br> value = string<br> }))) }))<br> enforcement_mode = string<br> tags = optional(list(object({<br> name = string<br> value = string<br> })), [])<br> operations = optional(list(object({<br> api_types = list(object({<br> api_type_id = string<br> }))<br> })))<br> })), [])<br><br> }))</pre> | n/a | yes |

### Outputs

Expand Down
1 change: 1 addition & 0 deletions modules/buckets/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module "buckets" {
source = "../../"
bucket_name = each.value.bucket_name
create_cos_instance = false
add_bucket_name_suffix = each.value.add_bucket_name_suffix
skip_iam_authorization_policy = each.value.skip_iam_authorization_policy
existing_cos_instance_id = each.value.resource_instance_id
region = each.value.region_location
Expand Down
1 change: 1 addition & 0 deletions modules/buckets/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
variable "bucket_configs" {
type = list(object({
access_tags = optional(list(string), [])
add_bucket_name_suffix = optional(bool, false)
bucket_name = string
kms_encryption_enabled = optional(bool, true)
kms_guid = optional(string, null)
Expand Down
2 changes: 1 addition & 1 deletion modules/fscloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ No resources.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_access_tags"></a> [access\_tags](#input\_access\_tags) | A list of access tags to apply to the cos instance created by the module, see https://cloud.ibm.com/docs/account?topic=account-access-tags-tutorial for more details | `list(string)` | `[]` | no |
| <a name="input_bucket_configs"></a> [bucket\_configs](#input\_bucket\_configs) | Cloud Object Storage bucket configurations | <pre>list(object({<br> access_tags = optional(list(string), [])<br> bucket_name = string<br> kms_encryption_enabled = optional(bool, true)<br> kms_guid = optional(string, null)<br> kms_key_crn = string<br> skip_iam_authorization_policy = optional(bool, false)<br> management_endpoint_type = string<br> cross_region_location = optional(string, null)<br> storage_class = optional(string, "smart")<br> region_location = optional(string, null)<br> resource_instance_id = optional(string, null)<br> force_delete = optional(bool, true)<br> single_site_location = optional(string, null)<br> hard_quota = optional(number, null)<br><br> activity_tracking = optional(object({<br> read_data_events = optional(bool, true)<br> write_data_events = optional(bool, true)<br> activity_tracker_crn = optional(string, null)<br> }))<br> archive_rule = optional(object({<br> enable = optional(bool, false)<br> days = optional(number, 20)<br> type = optional(string, "Glacier")<br> }))<br> expire_rule = optional(object({<br> enable = optional(bool, false)<br> days = optional(number, 365)<br> }))<br> metrics_monitoring = optional(object({<br> usage_metrics_enabled = optional(bool, true)<br> request_metrics_enabled = optional(bool, true)<br> metrics_monitoring_crn = optional(string, null)<br> }))<br> object_versioning = optional(object({<br> enable = optional(bool, false)<br> }))<br> retention_rule = optional(object({<br> default = optional(number, 90)<br> maximum = optional(number, 350)<br> minimum = optional(number, 90)<br> permanent = optional(bool, false)<br> }))<br> cbr_rules = optional(list(object({<br> description = string<br> account_id = string<br> rule_contexts = list(object({<br> attributes = optional(list(object({<br> name = string<br> value = string<br> }))) }))<br> enforcement_mode = string<br> tags = optional(list(object({<br> name = string<br> value = string<br> })), [])<br> operations = optional(list(object({<br> api_types = list(object({<br> api_type_id = string<br> }))<br> })))<br> })), [])<br><br> }))</pre> | `[]` | no |
| <a name="input_bucket_configs"></a> [bucket\_configs](#input\_bucket\_configs) | Cloud Object Storage bucket configurations | <pre>list(object({<br> access_tags = optional(list(string), [])<br> add_bucket_name_suffix = optional(bool, false)<br> bucket_name = string<br> kms_encryption_enabled = optional(bool, true)<br> kms_guid = optional(string, null)<br> kms_key_crn = string<br> skip_iam_authorization_policy = optional(bool, false)<br> management_endpoint_type = string<br> cross_region_location = optional(string, null)<br> storage_class = optional(string, "smart")<br> region_location = optional(string, null)<br> resource_instance_id = optional(string, null)<br> force_delete = optional(bool, true)<br> single_site_location = optional(string, null)<br> hard_quota = optional(number, null)<br><br> activity_tracking = optional(object({<br> read_data_events = optional(bool, true)<br> write_data_events = optional(bool, true)<br> activity_tracker_crn = optional(string, null)<br> }))<br> archive_rule = optional(object({<br> enable = optional(bool, false)<br> days = optional(number, 20)<br> type = optional(string, "Glacier")<br> }))<br> expire_rule = optional(object({<br> enable = optional(bool, false)<br> days = optional(number, 365)<br> }))<br> metrics_monitoring = optional(object({<br> usage_metrics_enabled = optional(bool, true)<br> request_metrics_enabled = optional(bool, true)<br> metrics_monitoring_crn = optional(string, null)<br> }))<br> object_versioning = optional(object({<br> enable = optional(bool, false)<br> }))<br> retention_rule = optional(object({<br> default = optional(number, 90)<br> maximum = optional(number, 350)<br> minimum = optional(number, 90)<br> permanent = optional(bool, false)<br> }))<br> cbr_rules = optional(list(object({<br> description = string<br> account_id = string<br> rule_contexts = list(object({<br> attributes = optional(list(object({<br> name = string<br> value = string<br> }))) }))<br> enforcement_mode = string<br> tags = optional(list(object({<br> name = string<br> value = string<br> })), [])<br> operations = optional(list(object({<br> api_types = list(object({<br> api_type_id = string<br> }))<br> })))<br> })), [])<br><br> }))</pre> | `[]` | no |
| <a name="input_cos_instance_name"></a> [cos\_instance\_name](#input\_cos\_instance\_name) | The name to give the cloud object storage instance that will be provisioned by this module. Only required if 'create\_cos\_instance' is true. | `string` | `null` | no |
| <a name="input_cos_plan"></a> [cos\_plan](#input\_cos\_plan) | Plan to be used for creating cloud object storage instance. Only used if 'create\_cos\_instance' it true. | `string` | `"standard"` | no |
| <a name="input_cos_tags"></a> [cos\_tags](#input\_cos\_tags) | Optional list of tags to be added to cloud object storage instance. Only used if 'create\_cos\_instance' it true. | `list(string)` | `[]` | no |
Expand Down
1 change: 1 addition & 0 deletions modules/fscloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ locals {
single_site_location = config.single_site_location
force_delete = config.force_delete
hard_quota = config.hard_quota
add_bucket_name_suffix = config.add_bucket_name_suffix
}
]
}
Expand Down
1 change: 1 addition & 0 deletions modules/fscloud/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ variable "cos_plan" {
variable "bucket_configs" {
type = list(object({
access_tags = optional(list(string), [])
add_bucket_name_suffix = optional(bool, false)
bucket_name = string
kms_encryption_enabled = optional(bool, true)
kms_guid = optional(string, null)
Expand Down

0 comments on commit f00db98

Please sign in to comment.