Skip to content

Commit

Permalink
fix: removed input variables sysdig_crn and activity_tracker_crn
Browse files Browse the repository at this point in the history
…from the fscloud submodule as they were unused. If you wish to set a bucket up with metrics or activity tracking, use the optional `activity_tracking` and `metrics_monitoring` options in the `bucket_configs` input variable, as demonstrated in the [fscloud example](https://github.com/terraform-ibm-modules/terraform-ibm-cos/tree/main/examples/fscloud) (#490)
  • Loading branch information
shemau authored Jan 2, 2024
1 parent f7d94d3 commit 00eeab4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 23 deletions.
15 changes: 8 additions & 7 deletions examples/fscloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,11 @@ module "cbr_zone_schematics" {
##############################################################################

module "cos_fscloud" {
source = "../../modules/fscloud"
resource_group_id = module.resource_group.resource_group_id
cos_instance_name = "${var.prefix}-cos"
cos_tags = var.resource_tags
sysdig_crn = module.observability_instances.cloud_monitoring_crn
activity_tracker_crn = local.at_crn
access_tags = var.access_tags
source = "../../modules/fscloud"
resource_group_id = module.resource_group.resource_group_id
cos_instance_name = "${var.prefix}-cos"
cos_tags = var.resource_tags
access_tags = var.access_tags

# CBR rule only allowing the COS instance to be accessbile over the private endpoint from within the VPC
# or from schematics
Expand Down Expand Up @@ -162,6 +160,9 @@ module "cos_fscloud" {
activity_tracking = {
activity_tracker_crn = local.at_crn
}
metrics_monitoring = {
metrics_monitoring_crn = module.observability_instances.cloud_monitoring_crn
}

# CBR rule only allowing the COS bucket to be accessbile over the private endpoint from within the VPC
cbr_rules = [{
Expand Down
2 changes: 0 additions & 2 deletions modules/fscloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ 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_activity_tracker_crn"></a> [activity\_tracker\_crn](#input\_activity\_tracker\_crn) | Activity tracker crn for COS bucket. Only required if 'create\_cos\_bucket' is true. | `string` | `null` | 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_group_id = string<br> resource_instance_id = optional(string, 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 |
Expand All @@ -107,7 +106,6 @@ No resources.
| <a name="input_hmac_key_role"></a> [hmac\_key\_role](#input\_hmac\_key\_role) | The role you want to be associated with your new hmac key. Valid roles are 'Writer', 'Reader', 'Manager', 'Content Reader', 'Object Reader', 'Object Writer'. | `string` | `"Manager"` | no |
| <a name="input_instance_cbr_rules"></a> [instance\_cbr\_rules](#input\_instance\_cbr\_rules) | (Optional, list) List of CBR rule to create for the instance | <pre>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> }))</pre> | `[]` | no |
| <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | The resource group ID where resources will be provisioned. | `string` | n/a | yes |
| <a name="input_sysdig_crn"></a> [sysdig\_crn](#input\_sysdig\_crn) | Sysdig Monitoring crn for COS bucket. Only required if 'create\_cos\_bucket' is true. | `string` | `null` | no |

### Outputs

Expand Down
2 changes: 0 additions & 2 deletions modules/fscloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ module "cos_instance" {
hmac_key_role = var.hmac_key_role
cos_plan = var.cos_plan
cos_tags = var.cos_tags
sysdig_crn = var.sysdig_crn
activity_tracker_crn = var.activity_tracker_crn
access_tags = var.access_tags
}

Expand Down
12 changes: 0 additions & 12 deletions modules/fscloud/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,6 @@ variable "cos_plan" {
}
}

variable "activity_tracker_crn" {
type = string
description = "Activity tracker crn for COS bucket. Only required if 'create_cos_bucket' is true."
default = null
}

variable "sysdig_crn" {
type = string
description = "Sysdig Monitoring crn for COS bucket. Only required if 'create_cos_bucket' is true."
default = null
}

##############################################################################
# COS bucket variables
##############################################################################
Expand Down

0 comments on commit 00eeab4

Please sign in to comment.