Skip to content

Commit 191d072

Browse files
authored
feat!: Update AWS provider to v5.0, replace ebs_volume_size attribute (#8)
1 parent cdc8cd2 commit 191d072

File tree

17 files changed

+658
-470
lines changed

17 files changed

+658
-470
lines changed

.github/workflows/pre-commit.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88

99
env:
1010
TERRAFORM_DOCS_VERSION: v0.16.0
11+
TFLINT_VERSION: v0.44.1
1112

1213
jobs:
1314
collectInputs:
@@ -17,11 +18,11 @@ jobs:
1718
directories: ${{ steps.dirs.outputs.directories }}
1819
steps:
1920
- name: Checkout
20-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
2122

2223
- name: Get root directories
2324
id: dirs
24-
uses: clowdhaus/terraform-composite-actions/directories@v1.4.0
25+
uses: clowdhaus/terraform-composite-actions/directories@v1.8.3
2526

2627
preCommitMinVersions:
2728
name: Min TF pre-commit
@@ -32,28 +33,30 @@ jobs:
3233
directory: ${{ fromJson(needs.collectInputs.outputs.directories) }}
3334
steps:
3435
- name: Checkout
35-
uses: actions/checkout@v2
36+
uses: actions/checkout@v3
3637

3738
- name: Terraform min/max versions
3839
id: minMax
39-
uses: clowdhaus/terraform-min-max@v1.0.4
40+
uses: clowdhaus/terraform-min-max@v1.2.4
4041
with:
4142
directory: ${{ matrix.directory }}
4243

4344
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
4445
# Run only validate pre-commit check on min version supported
4546
if: ${{ matrix.directory != '.' }}
46-
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.4.0
47+
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3
4748
with:
4849
terraform-version: ${{ steps.minMax.outputs.minVersion }}
50+
tflint-version: ${{ env.TFLINT_VERSION }}
4951
args: 'terraform_validate --color=always --show-diff-on-failure --files ${{ matrix.directory }}/*'
5052

5153
- name: Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}
5254
# Run only validate pre-commit check on min version supported
5355
if: ${{ matrix.directory == '.' }}
54-
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.4.0
56+
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3
5557
with:
5658
terraform-version: ${{ steps.minMax.outputs.minVersion }}
59+
tflint-version: ${{ env.TFLINT_VERSION }}
5760
args: 'terraform_validate --color=always --show-diff-on-failure --files $(ls *.tf)'
5861

5962
preCommitMaxVersion:
@@ -62,17 +65,19 @@ jobs:
6265
needs: collectInputs
6366
steps:
6467
- name: Checkout
65-
uses: actions/checkout@v2
68+
uses: actions/checkout@v3
6669
with:
6770
ref: ${{ github.event.pull_request.head.ref }}
6871
repository: ${{github.event.pull_request.head.repo.full_name}}
6972

7073
- name: Terraform min/max versions
7174
id: minMax
72-
uses: clowdhaus/terraform-min-max@v1.0.4
75+
uses: clowdhaus/terraform-min-max@v1.2.4
7376

7477
- name: Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}
75-
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.4.0
78+
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.8.3
7679
with:
7780
terraform-version: ${{ steps.minMax.outputs.maxVersion }}
81+
tflint-version: ${{ env.TFLINT_VERSION }}
7882
terraform-docs-version: ${{ env.TERRAFORM_DOCS_VERSION }}
83+
install-hcledit: true

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.62.3
3+
rev: v1.81.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_validate
@@ -23,7 +23,7 @@ repos:
2323
- '--args=--only=terraform_standard_module_structure'
2424
- '--args=--only=terraform_workspace_remote'
2525
- repo: https://github.com/pre-commit/pre-commit-hooks
26-
rev: v4.1.0
26+
rev: v4.4.0
2727
hooks:
2828
- id: check-merge-conflict
2929
- id: end-of-file-fixer

README.md

Lines changed: 44 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ module "msk_kafka_cluster" {
1111
source = "clowdhaus/msk-kafka-cluster/aws"
1212
1313
name = local.name
14-
kafka_version = "2.8.0"
14+
kafka_version = "3.4.0"
1515
number_of_broker_nodes = 3
1616
enhanced_monitoring = "PER_TOPIC_PER_PARTITION"
1717
18-
broker_node_client_subnets = ["subnet-12345678", "subnet-024681012", "subnet-87654321"]
19-
broker_node_ebs_volume_size = 20
18+
broker_node_client_subnets = ["subnet-12345678", "subnet-024681012", "subnet-87654321"]
19+
broker_node_storage_info = {
20+
ebs_storage_info = { volume_size = 100 }
21+
}
2022
broker_node_instance_type = "kafka.t3.small"
2123
broker_node_security_groups = ["sg-12345678"]
2224
@@ -40,8 +42,10 @@ module "msk_kafka_cluster" {
4042
scaling_max_capacity = 512
4143
scaling_target_value = 80
4244
43-
client_authentication_sasl_scram = true
44-
create_scram_secret_association = true
45+
client_authentication = {
46+
sasl = { scram = true }
47+
}
48+
create_scram_secret_association = true
4549
scram_secret_association_secret_arn_list = [
4650
aws_secretsmanager_secret.one.arn,
4751
aws_secretsmanager_secret.two.arn,
@@ -75,25 +79,30 @@ module "msk_kafka_cluster" {
7579
description = "Schema that contains all the records"
7680
compatibility = "FORWARD"
7781
team_b_records = {
78-
schema_registry_name = "team_b"
79-
schema_name = "records"
80-
description = "Schema that contains all the records"
81-
compatibility = "FORWARD"
82-
schema_definition = jsonencode({
83-
type = "record"
84-
name = "r1"
85-
fields = [{
86-
name = "f1"
87-
type = "int"
88-
}, {
89-
name = "f2"
90-
type = "string"
91-
}, {
92-
name = "f3"
93-
type = "boolean"
94-
}]
95-
})
96-
tags = { Team = "Team B" }
82+
schema_registry_name = "team_b"
83+
schema_name = "records"
84+
description = "Schema that contains all the records"
85+
compatibility = "FORWARD"
86+
schema_definition = jsonencode({
87+
type = "record"
88+
name = "r1"
89+
fields = [
90+
{
91+
name = "f1"
92+
type = "int"
93+
},
94+
{
95+
name = "f2"
96+
type = "string"
97+
},
98+
{
99+
name = "f3"
100+
type = "boolean"
101+
}
102+
]
103+
})
104+
tags = { Team = "Team B" }
105+
}
97106
}
98107
}
99108
@@ -111,34 +120,19 @@ Examples codified under the [`examples`](https://github.com/clowdhaus/terraform-
111120
- [Basic](https://github.com/clowdhaus/terraform-aws-msk-kafka-cluster/tree/main/examples/basic)
112121
- [Complete](https://github.com/clowdhaus/terraform-aws-msk-kafka-cluster/tree/main/examples/complete)
113122

114-
## Security & Compliance [<img src="https://raw.githubusercontent.com/clowdhaus/terraform-aws-msk-kafka-cluster/main/.github/images/bridgecrew.svg" width="250" align="right" />](https://bridgecrew.io/)
115-
116-
Security scanning results provided by Bridgecrew. Bridgecrew is the leading fully hosted, cloud-native solution providing continuous Terraform security and compliance.
117-
118-
| Benchmark | Description |
119-
|--------|---------------|
120-
| [![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/clowdhaus/terraform-aws-msk-kafka-cluster/general)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=clowdhaus%2Fterraform-aws-msk-kafka-cluster&benchmark=INFRASTRUCTURE+SECURITY) | Infrastructure Security Compliance |
121-
| [![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/clowdhaus/terraform-aws-msk-kafka-cluster/cis_aws)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=clowdhaus%2Fterraform-aws-msk-kafka-cluster&benchmark=CIS+AWS+V1.2) | Center for Internet Security, AWS Compliance |
122-
| [![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/clowdhaus/terraform-aws-msk-kafka-cluster/pci_dss_v321)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=clowdhaus%2Fterraform-aws-msk-kafka-cluster&benchmark=PCI-DSS+V3.2.1) | Payment Card Industry Data Security Standards Compliance |
123-
| [![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/clowdhaus/terraform-aws-msk-kafka-cluster/nist)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=clowdhaus%2Fterraform-aws-msk-kafka-cluster&benchmark=NIST-800-53) | National Institute of Standards and Technology Compliance |
124-
| [![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/clowdhaus/terraform-aws-msk-kafka-cluster/iso)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=clowdhaus%2Fterraform-aws-msk-kafka-cluster&benchmark=ISO27001) | Information Security Management System, ISO/IEC 27001 Compliance |
125-
| [![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/clowdhaus/terraform-aws-msk-kafka-cluster/soc2)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=clowdhaus%2Fterraform-aws-msk-kafka-cluster&benchmark=SOC2) | Service Organization Control 2 Compliance |
126-
| [![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/clowdhaus/terraform-aws-msk-kafka-cluster/hipaa)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=clowdhaus%2Fterraform-aws-msk-kafka-cluster&benchmark=HIPAA) | Health Insurance Portability and Accountability Compliance |
127-
| [![Infrastructure Tests](https://www.bridgecrew.cloud/badges/github/clowdhaus/terraform-aws-msk-kafka-cluster/fedramp_moderate)](https://www.bridgecrew.cloud/link/badge?vcs=github&fullRepo=clowdhaus%2Fterraform-aws-msk-kafka-cluster&benchmark=FEDRAMP+%28MODERATE%29) | FedRAMP Moderate Impact Level |
128-
129123
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
130124
## Requirements
131125

132126
| Name | Version |
133127
|------|---------|
134-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.13.1 |
135-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.71 |
128+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
129+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.0 |
136130

137131
## Providers
138132

139133
| Name | Version |
140134
|------|---------|
141-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.71 |
135+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.0 |
142136

143137
## Modules
144138

@@ -163,19 +157,21 @@ No modules.
163157

164158
| Name | Description | Type | Default | Required |
165159
|------|-------------|------|---------|:--------:|
160+
| <a name="input_broker_node_az_distribution"></a> [broker\_node\_az\_distribution](#input\_broker\_node\_az\_distribution) | The distribution of broker nodes across availability zones ([documentation](https://docs.aws.amazon.com/msk/1.0/apireference/clusters.html#clusters-model-brokerazdistribution)). Currently the only valid value is `DEFAULT` | `string` | `null` | no |
166161
| <a name="input_broker_node_client_subnets"></a> [broker\_node\_client\_subnets](#input\_broker\_node\_client\_subnets) | A list of subnets to connect to in client VPC ([documentation](https://docs.aws.amazon.com/msk/1.0/apireference/clusters.html#clusters-prop-brokernodegroupinfo-clientsubnets)) | `list(string)` | `[]` | no |
167-
| <a name="input_broker_node_ebs_volume_size"></a> [broker\_node\_ebs\_volume\_size](#input\_broker\_node\_ebs\_volume\_size) | The size in GiB of the EBS volume for the data drive on each broker node | `number` | `null` | no |
162+
| <a name="input_broker_node_connectivity_info"></a> [broker\_node\_connectivity\_info](#input\_broker\_node\_connectivity\_info) | Information about the cluster access configuration | `any` | `{}` | no |
168163
| <a name="input_broker_node_instance_type"></a> [broker\_node\_instance\_type](#input\_broker\_node\_instance\_type) | Specify the instance type to use for the kafka brokers. e.g. kafka.m5.large. ([Pricing info](https://aws.amazon.com/msk/pricing/)) | `string` | `null` | no |
169164
| <a name="input_broker_node_security_groups"></a> [broker\_node\_security\_groups](#input\_broker\_node\_security\_groups) | A list of the security groups to associate with the elastic network interfaces to control who can communicate with the cluster | `list(string)` | `[]` | no |
170-
| <a name="input_client_authentication_sasl_iam"></a> [client\_authentication\_sasl\_iam](#input\_client\_authentication\_sasl\_iam) | Enables IAM client authentication | `bool` | `false` | no |
171-
| <a name="input_client_authentication_sasl_scram"></a> [client\_authentication\_sasl\_scram](#input\_client\_authentication\_sasl\_scram) | Enables SCRAM client authentication via AWS Secrets Manager | `bool` | `false` | no |
172-
| <a name="input_client_authentication_tls_certificate_authority_arns"></a> [client\_authentication\_tls\_certificate\_authority\_arns](#input\_client\_authentication\_tls\_certificate\_authority\_arns) | List of ACM Certificate Authority Amazon Resource Names (ARNs) | `list(string)` | `[]` | no |
165+
| <a name="input_broker_node_storage_info"></a> [broker\_node\_storage\_info](#input\_broker\_node\_storage\_info) | A block that contains information about storage volumes attached to MSK broker nodes | `any` | `{}` | no |
166+
| <a name="input_client_authentication"></a> [client\_authentication](#input\_client\_authentication) | Configuration block for specifying a client authentication | `any` | `{}` | no |
173167
| <a name="input_cloudwatch_log_group_kms_key_id"></a> [cloudwatch\_log\_group\_kms\_key\_id](#input\_cloudwatch\_log\_group\_kms\_key\_id) | The ARN of the KMS Key to use when encrypting log data | `string` | `null` | no |
174168
| <a name="input_cloudwatch_log_group_name"></a> [cloudwatch\_log\_group\_name](#input\_cloudwatch\_log\_group\_name) | Name of the Cloudwatch Log Group to deliver logs to | `string` | `null` | no |
175169
| <a name="input_cloudwatch_log_group_retention_in_days"></a> [cloudwatch\_log\_group\_retention\_in\_days](#input\_cloudwatch\_log\_group\_retention\_in\_days) | Specifies the number of days you want to retain log events in the log group | `number` | `0` | no |
176170
| <a name="input_cloudwatch_logs_enabled"></a> [cloudwatch\_logs\_enabled](#input\_cloudwatch\_logs\_enabled) | Indicates whether you want to enable or disable streaming broker logs to Cloudwatch Logs | `bool` | `false` | no |
171+
| <a name="input_configuration_arn"></a> [configuration\_arn](#input\_configuration\_arn) | ARN of an externally created configuration to use | `string` | `null` | no |
177172
| <a name="input_configuration_description"></a> [configuration\_description](#input\_configuration\_description) | Description of the configuration | `string` | `null` | no |
178173
| <a name="input_configuration_name"></a> [configuration\_name](#input\_configuration\_name) | Name of the configuration | `string` | `null` | no |
174+
| <a name="input_configuration_revision"></a> [configuration\_revision](#input\_configuration\_revision) | Revision of the externally created configuration to use | `number` | `null` | no |
179175
| <a name="input_configuration_server_properties"></a> [configuration\_server\_properties](#input\_configuration\_server\_properties) | Contents of the server.properties file. Supported properties are documented in the [MSK Developer Guide](https://docs.aws.amazon.com/msk/latest/developerguide/msk-configuration-properties.html) | `map(string)` | `{}` | no |
180176
| <a name="input_connect_custom_plugin_timeouts"></a> [connect\_custom\_plugin\_timeouts](#input\_connect\_custom\_plugin\_timeouts) | Timeout configurations for the connect custom plugins | `map(string)` | <pre>{<br> "create": null<br>}</pre> | no |
181177
| <a name="input_connect_custom_plugins"></a> [connect\_custom\_plugins](#input\_connect\_custom\_plugins) | Map of custom plugin configuration details (map of maps) | `any` | `{}` | no |
@@ -184,6 +180,7 @@ No modules.
184180
| <a name="input_connect_worker_config_properties_file_content"></a> [connect\_worker\_config\_properties\_file\_content](#input\_connect\_worker\_config\_properties\_file\_content) | Contents of connect-distributed.properties file. The value can be either base64 encoded or in raw format | `string` | `null` | no |
185181
| <a name="input_create"></a> [create](#input\_create) | Determines whether cluster resources will be created | `bool` | `true` | no |
186182
| <a name="input_create_cloudwatch_log_group"></a> [create\_cloudwatch\_log\_group](#input\_create\_cloudwatch\_log\_group) | Determines whether to create a CloudWatch log group | `bool` | `true` | no |
183+
| <a name="input_create_configuration"></a> [create\_configuration](#input\_create\_configuration) | Determines whether to create a configuration | `bool` | `true` | no |
187184
| <a name="input_create_connect_worker_configuration"></a> [create\_connect\_worker\_configuration](#input\_create\_connect\_worker\_configuration) | Determines whether to create connect worker configuration | `bool` | `false` | no |
188185
| <a name="input_create_schema_registry"></a> [create\_schema\_registry](#input\_create\_schema\_registry) | Determines whether to create a Glue schema registry for managing Avro schemas for the cluster | `bool` | `true` | no |
189186
| <a name="input_create_scram_secret_association"></a> [create\_scram\_secret\_association](#input\_create\_scram\_secret\_association) | Determines whether to create SASL/SCRAM secret association | `bool` | `false` | no |
@@ -207,6 +204,7 @@ No modules.
207204
| <a name="input_schema_registries"></a> [schema\_registries](#input\_schema\_registries) | A map of schema registries to be created | `map(any)` | `{}` | no |
208205
| <a name="input_schemas"></a> [schemas](#input\_schemas) | A map schemas to be created within the schema registry | `map(any)` | `{}` | no |
209206
| <a name="input_scram_secret_association_secret_arn_list"></a> [scram\_secret\_association\_secret\_arn\_list](#input\_scram\_secret\_association\_secret\_arn\_list) | List of AWS Secrets Manager secret ARNs to associate with SCRAM | `list(string)` | `[]` | no |
207+
| <a name="input_storage_mode"></a> [storage\_mode](#input\_storage\_mode) | Controls storage mode for supported storage tiers. Valid values are: `LOCAL` or `TIERED` | `string` | `null` | no |
210208
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to assign to the resources created | `map(string)` | `{}` | no |
211209
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | Create, update, and delete timeout configurations for the cluster | `map(string)` | `{}` | no |
212210

0 commit comments

Comments
 (0)