Skip to content

Commit 641d11a

Browse files
committed
Merge branch 'main' into test-dev
2 parents 8187761 + 4839fc7 commit 641d11a

File tree

6 files changed

+90
-87
lines changed

6 files changed

+90
-87
lines changed

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ module "automq-byoc" {
4545
4646
# Set the target regionId of aws
4747
cloud_provider_region = "ap-southeast-1"
48+
49+
# Optional: Add additional tags to all resources
50+
additional_tags = {
51+
Environment = "Production"
52+
Project = "MyProject"
53+
Owner = "TeamA"
54+
CostCenter = "Engineering"
55+
}
4856
}
4957
5058
# Necessary outputs
@@ -187,20 +195,20 @@ output "automq_byoc_instance_id" {
187195
| Name | Version |
188196
|------|---------|
189197
| <a name="requirement_terraform"></a> [terraform](#requirement_terraform) | >= 1.0 |
190-
| <a name="requirement_aws"></a> [aws](#requirement_aws) | >= 5.30 |
198+
| <a name="requirement_aws"></a> [aws](#requirement_aws) | >= 6.0 |
191199

192200
## Providers
193201

194202
| Name | Version |
195203
|------|---------|
196-
| <a name="provider_aws"></a> [aws](#provider_aws) | 5.81.0 |
204+
| <a name="provider_aws"></a> [aws](#provider_aws) | 6.11.0 |
197205

198206
## Modules
199207

200208
| Name | Source | Version |
201209
|------|--------|---------|
202-
| <a name="module_automq_byoc_data_bucket_name"></a> [automq_byoc_data_bucket_name](#module_automq_byoc_data_bucket_name) | terraform-aws-modules/s3-bucket/aws | 4.1.2 |
203-
| <a name="module_automq_byoc_ops_bucket_name"></a> [automq_byoc_ops_bucket_name](#module_automq_byoc_ops_bucket_name) | terraform-aws-modules/s3-bucket/aws | 4.1.2 |
210+
| <a name="module_automq_byoc_data_bucket_name"></a> [automq_byoc_data_bucket_name](#module_automq_byoc_data_bucket_name) | terraform-aws-modules/s3-bucket/aws | 5.4.0 |
211+
| <a name="module_automq_byoc_ops_bucket_name"></a> [automq_byoc_ops_bucket_name](#module_automq_byoc_ops_bucket_name) | terraform-aws-modules/s3-bucket/aws | 5.4.0 |
204212
| <a name="module_automq_byoc_vpc"></a> [automq_byoc_vpc](#module_automq_byoc_vpc) | terraform-aws-modules/vpc/aws | 5.0.0 |
205213

206214
## Resources
@@ -242,10 +250,12 @@ output "automq_byoc_instance_id" {
242250
| <a name="input_automq_byoc_data_bucket_name"></a> [automq_byoc_data_bucket_name](#input_automq_byoc_data_bucket_name) | Set the existed S3 bucket used to store message data generated by applications. If this parameter is not set, a new S3 bucket will be automatically created. The message data Bucket must be separate from the Ops Bucket. | `string` | `""` | no |
243251
| <a name="input_automq_byoc_ops_bucket_name"></a> [automq_byoc_ops_bucket_name](#input_automq_byoc_ops_bucket_name) | Set the existed S3 bucket used to store AutoMQ system logs and metrics data for system monitoring and alerts. If this parameter is not set, a new S3 bucket will be automatically created. This Bucket does not contain any application business data. The Ops Bucket must be separate from the message data Bucket. | `string` | `""` | no |
244252
| <a name="input_automq_byoc_ec2_instance_type"></a> [automq_byoc_ec2_instance_type](#input_automq_byoc_ec2_instance_type) | Set the EC2 instance type; this parameter is used only for deploying the AutoMQ environment console. You need to provide an EC2 instance type with at least 2 cores and 8 GB of memory. | `string` | `"t3.large"` | no |
245-
| <a name="input_automq_byoc_env_version"></a> [automq_byoc_env_version](#input_automq_byoc_env_version) | Set the version for the AutoMQ BYOC environment console. It is recommended to keep the default value, which is the latest version. Historical release note reference [document](https://docs.automq.com/automq-cloud/release-notes). | `string` | `"1.5.12"` | no |
253+
| <a name="input_automq_byoc_env_version"></a> [automq_byoc_env_version](#input_automq_byoc_env_version) | Set the version for the AutoMQ BYOC environment console. It is recommended to keep the default value, which is the latest version. Historical release note reference [document](https://docs.automq.com/automq-cloud/release-notes). | `string` | `"7.7.1"` | no |
246254
| <a name="input_automq_byoc_env_console_key_name"></a> [automq_byoc_env_console_key_name](#input_automq_byoc_env_console_key_name) | Specify the key pair name for accessing the AutoMQ BYOC environment console. If not specified, the console will be deployed without a key pair. | `string` | `""` | no |
247255
| <a name="input_use_custom_ami"></a> [use_custom_ami](#input_use_custom_ami) | The parameter defaults to false, which means a specific AMI is not specified. If you wish to use a custom AMI, set this parameter to true and specify the `automq_byoc_env_console_ami` parameter with your custom AMI ID. | `bool` | `false` | no |
248256
| <a name="input_automq_byoc_env_console_ami"></a> [automq_byoc_env_console_ami](#input_automq_byoc_env_console_ami) | When the `use_custom_ami` parameter is set to true, this parameter must be set with a custom AMI Name to deploy the AutoMQ console. | `string` | `""` | no |
257+
| <a name="input_automq_enviroment_console_init"></a> [automq_enviroment_console_init](#input_automq_enviroment_console_init) | Controls the environment console initialization. When false, manual initialization is required. Default is true. | `bool` | `true` | no |
258+
| <a name="input_additional_tags"></a> [additional_tags](#input_additional_tags) | Additional tags to apply to all resources created by this module. | `map(string)` | `{}` | no |
249259

250260
## Outputs
251261

@@ -258,8 +268,11 @@ output "automq_byoc_instance_id" {
258268
| <a name="output_automq_byoc_vpc_id"></a> [automq_byoc_vpc_id](#output_automq_byoc_vpc_id) | The VPC ID for the AutoMQ environment deployment. |
259269
| <a name="output_automq_byoc_instance_id"></a> [automq_byoc_instance_id](#output_automq_byoc_instance_id) | The EC2 instance id for AutoMQ Console. |
260270
| <a name="output_automq_byoc_console_role_arn"></a> [automq_byoc_console_role_arn](#output_automq_byoc_console_role_arn) | AutoMQ BYOC is bound to the role arn of the Console. |
261-
| <a name="output_automq_byoc_eks_node_role_arn"></a> [automq_byoc_eks_node_role_arn](#output_automq_byoc_eks_node_role_arn) | AutoMQ BYOC requires this role to be bound to the EKS Node group. |
271+
| <a name="output_automq_byoc_console_instance_profile_arn"></a> [automq_byoc_console_instance_profile_arn](#output_automq_byoc_console_instance_profile_arn) | IAM Instance profiles ARN |
262272
| <a name="output_automq_byoc_security_group_id"></a> [automq_byoc_security_group_id](#output_automq_byoc_security_group_id) | Security group bound to the AutoMQ BYOC service. |
263273
| <a name="output_public_subnet_id"></a> [public_subnet_id](#output_public_subnet_id) | The VPC subnet for the AutoMQ environment deployment. |
264274
| <a name="output_private_subnets"></a> [private_subnets](#output_private_subnets) | The VPC subnet for the AutoMQ environment deployment.If the create_new_vpc is set to true, the private subnet will be created. |
275+
| <a name="output_automq_byoc_vpc_route53_zone_id"></a> [automq_byoc_vpc_route53_zone_id](#output_automq_byoc_vpc_route53_zone_id) | Route53 bound to the VPC. |
276+
| <a name="output_automq_byoc_data_bucket_name"></a> [automq_byoc_data_bucket_name](#output_automq_byoc_data_bucket_name) | The object storage bucket for that used to store message data generated by applications. The message data Bucket must be separate from the Ops Bucket. |
277+
| <a name="output_automq_byoc_ops_bucket_name"></a> [automq_byoc_ops_bucket_name](#output_automq_byoc_ops_bucket_name) | The object storage bucket for that used to store AutoMQ system logs and metrics data for system monitoring and alerts. This Bucket does not contain any application business data. The Ops Bucket must be separate from the message data Bucket. |
265278
<!-- END_TF_DOCS -->

aws.tf

Lines changed: 52 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,25 @@ provider "aws" {
55
# Conditional creation of data bucket
66
module "automq_byoc_data_bucket_name" {
77
source = "terraform-aws-modules/s3-bucket/aws"
8-
version = "4.1.2"
8+
version = "5.4.0"
99

1010
create_bucket = var.automq_byoc_data_bucket_name == "" ? true : false
1111
bucket = "automq-data-${var.automq_byoc_env_id}"
1212
force_destroy = true
1313

14-
tags = {
15-
automqVendor = "automq"
16-
automqEnvironmentID = var.automq_byoc_env_id
17-
}
14+
tags = local.common_tags
1815
}
1916

2017
# Conditional creation of ops bucket
2118
module "automq_byoc_ops_bucket_name" {
2219
source = "terraform-aws-modules/s3-bucket/aws"
23-
version = "4.1.2"
20+
version = "5.4.0"
2421

2522
create_bucket = var.automq_byoc_ops_bucket_name == "" ? true : false
2623
bucket = "automq-ops-${var.automq_byoc_env_id}"
2724
force_destroy = true
2825

29-
tags = {
30-
automqVendor = "automq"
31-
automqEnvironmentID = var.automq_byoc_env_id
32-
}
26+
tags = local.common_tags
3327
}
3428

3529
data "aws_availability_zones" "available_azs" {}
@@ -54,10 +48,7 @@ module "automq_byoc_vpc" {
5448
enable_nat_gateway = true
5549
single_nat_gateway = true
5650

57-
tags = {
58-
automqVendor = "automq"
59-
automqEnvironmentID = var.automq_byoc_env_id
60-
}
51+
tags = local.common_tags
6152
}
6253

6354
resource "aws_security_group" "vpc_endpoint_sg" {
@@ -80,11 +71,12 @@ resource "aws_security_group" "vpc_endpoint_sg" {
8071
cidr_blocks = ["0.0.0.0/0"]
8172
}
8273

83-
tags = {
84-
Name = "automq-byoc-endpoint-sg-${var.automq_byoc_env_id}"
85-
automqVendor = "automq"
86-
automqEnvironmentID = var.automq_byoc_env_id
87-
}
74+
tags = merge(
75+
local.common_tags,
76+
{
77+
Name = "automq-byoc-endpoint-sg-${var.automq_byoc_env_id}"
78+
}
79+
)
8880
}
8981

9082
resource "aws_vpc_endpoint" "ec2_endpoint" {
@@ -98,11 +90,12 @@ resource "aws_vpc_endpoint" "ec2_endpoint" {
9890

9991
private_dns_enabled = true
10092

101-
tags = {
102-
Name = "automq-byoc-ec2-endpoint-${var.automq_byoc_env_id}"
103-
automqVendor = "automq"
104-
automqEnvironmentID = var.automq_byoc_env_id
105-
}
93+
tags = merge(
94+
local.common_tags,
95+
{
96+
Name = "automq-byoc-ec2-endpoint-${var.automq_byoc_env_id}"
97+
}
98+
)
10699
}
107100

108101
resource "aws_vpc_endpoint" "s3_endpoint" {
@@ -117,11 +110,12 @@ resource "aws_vpc_endpoint" "s3_endpoint" {
117110
module.automq_byoc_vpc[0].private_route_table_ids
118111
)
119112

120-
tags = {
121-
Name = "automq-byoc-s3-endpoint-${var.automq_byoc_env_id}"
122-
automqVendor = "automq"
123-
automqEnvironmentID = var.automq_byoc_env_id
124-
}
113+
tags = merge(
114+
local.common_tags,
115+
{
116+
Name = "automq-byoc-s3-endpoint-${var.automq_byoc_env_id}"
117+
}
118+
)
125119
}
126120

127121
resource "aws_vpc_endpoint" "s3table_endpoint" {
@@ -135,11 +129,12 @@ resource "aws_vpc_endpoint" "s3table_endpoint" {
135129

136130
private_dns_enabled = true
137131

138-
tags = {
139-
Name = "automq-byoc-ec2-endpoint-${var.automq_byoc_env_id}"
140-
automqVendor = "automq"
141-
automqEnvironmentID = var.automq_byoc_env_id
142-
}
132+
tags = merge(
133+
local.common_tags,
134+
{
135+
Name = "automq-byoc-s3table-endpoint-${var.automq_byoc_env_id}"
136+
}
137+
)
143138
}
144139

145140
resource "aws_vpc_endpoint" "glue_endpoint" {
@@ -153,11 +148,12 @@ resource "aws_vpc_endpoint" "glue_endpoint" {
153148

154149
private_dns_enabled = true
155150

156-
tags = {
157-
Name = "automq-byoc-ec2-endpoint-${var.automq_byoc_env_id}"
158-
automqVendor = "automq"
159-
automqEnvironmentID = var.automq_byoc_env_id
160-
}
151+
tags = merge(
152+
local.common_tags,
153+
{
154+
Name = "automq-byoc-glue-endpoint-${var.automq_byoc_env_id}"
155+
}
156+
)
161157
}
162158

163159
locals {
@@ -166,6 +162,15 @@ locals {
166162
automq_data_bucket = var.automq_byoc_data_bucket_name == "" ? module.automq_byoc_data_bucket_name.s3_bucket_id : "${var.automq_byoc_data_bucket_name}"
167163
automq_ops_bucket = var.automq_byoc_ops_bucket_name == "" ? module.automq_byoc_ops_bucket_name.s3_bucket_id : "${var.automq_byoc_ops_bucket_name}"
168164
zone_id = aws_route53_zone.private_r53.zone_id
165+
166+
# Common tags that will be applied to all resources
167+
common_tags = merge(
168+
{
169+
automqVendor = "automq"
170+
automqEnvironmentID = var.automq_byoc_env_id
171+
},
172+
var.additional_tags
173+
)
169174
}
170175

171176
data "aws_vpc" "vpc_id" {
@@ -178,6 +183,7 @@ locals {
178183

179184
data "aws_ami" "console_ami" {
180185
most_recent = true
186+
owners = ["730389100204"]
181187

182188
filter {
183189
name = "name"
@@ -210,10 +216,7 @@ resource "aws_security_group" "automq_byoc_console_sg" {
210216
cidr_blocks = ["0.0.0.0/0"]
211217
}
212218

213-
tags = {
214-
automqVendor = "automq"
215-
automqEnvironmentID = var.automq_byoc_env_id
216-
}
219+
tags = local.common_tags
217220
}
218221

219222
resource "aws_iam_role" "automq_byoc_role" {
@@ -233,10 +236,7 @@ resource "aws_iam_role" "automq_byoc_role" {
233236
]
234237
})
235238

236-
tags = {
237-
automqVendor = "automq"
238-
automqEnvironmentID = var.automq_byoc_env_id
239-
}
239+
tags = local.common_tags
240240
}
241241

242242
resource "aws_iam_policy" "automq_byoc_policy" {
@@ -248,10 +248,7 @@ resource "aws_iam_policy" "automq_byoc_policy" {
248248
automq_ops_bucket = local.automq_ops_bucket
249249
})
250250

251-
tags = {
252-
automqVendor = "automq"
253-
automqEnvironmentID = var.automq_byoc_env_id
254-
}
251+
tags = local.common_tags
255252
}
256253

257254
resource "aws_iam_policy" "automq_byoc_k8s_policy" {
@@ -263,10 +260,7 @@ resource "aws_iam_policy" "automq_byoc_k8s_policy" {
263260
automq_ops_bucket = local.automq_ops_bucket
264261
})
265262

266-
tags = {
267-
automqVendor = "automq"
268-
automqEnvironmentID = var.automq_byoc_env_id
269-
}
263+
tags = local.common_tags
270264
}
271265

272266
resource "aws_iam_role_policy_attachment" "automq_byoc_role_attachment_k8s" {
@@ -283,10 +277,7 @@ resource "aws_iam_instance_profile" "automq_byoc_instance_profile" {
283277
name = "automq-byoc-instance-profile-${var.automq_byoc_env_id}"
284278
role = aws_iam_role.automq_byoc_role.name
285279

286-
tags = {
287-
automqVendor = "automq"
288-
automqEnvironmentID = var.automq_byoc_env_id
289-
}
280+
tags = local.common_tags
290281
}
291282

292283
resource "aws_route53_zone" "private_r53" {
@@ -300,18 +291,12 @@ resource "aws_route53_zone" "private_r53" {
300291
create_before_destroy = true
301292
}
302293

303-
tags = {
304-
automqVendor = "automq"
305-
automqEnvironmentID = var.automq_byoc_env_id
306-
}
294+
tags = local.common_tags
307295
}
308296

309297
resource "aws_eip" "web_ip" {
310298
instance = aws_instance.automq_byoc_console.id
311-
tags = {
312-
automqVendor = "automq"
313-
automqEnvironmentID = var.automq_byoc_env_id
314-
}
299+
tags = local.common_tags
315300
}
316301

317302
locals {

main.tf

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ resource "aws_instance" "automq_byoc_console" {
1313

1414
key_name = var.automq_byoc_env_console_key_name
1515

16-
tags = {
17-
Name = "automq-byoc-console-${var.automq_byoc_env_id}"
18-
automqVendor = "automq"
19-
automqEnvironmentID = var.automq_byoc_env_id
20-
}
16+
tags = merge(
17+
local.common_tags,
18+
{
19+
Name = "automq-byoc-console-${var.automq_byoc_env_id}"
20+
}
21+
)
2122

2223
associate_public_ip_address = true
2324

@@ -38,10 +39,7 @@ resource "aws_ebs_volume" "data_volume" {
3839
size = 20
3940
type = "gp3"
4041

41-
tags = {
42-
automqVendor = "automq"
43-
automqEnvironmentID = var.automq_byoc_env_id
44-
}
42+
tags = local.common_tags
4543
}
4644

4745
resource "aws_volume_attachment" "data_volume_attachment" {

outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ output "automq_byoc_vpc_route53_zone_id" {
6161

6262
output "automq_byoc_data_bucket_name" {
6363
description = "The object storage bucket for that used to store message data generated by applications. The message data Bucket must be separate from the Ops Bucket."
64-
value = local.automq_data_bucket
64+
value = local.automq_data_bucket
6565
}
6666

6767
output "automq_byoc_ops_bucket_name" {
6868
description = "The object storage bucket for that used to store AutoMQ system logs and metrics data for system monitoring and alerts. This Bucket does not contain any application business data. The Ops Bucket must be separate from the message data Bucket."
69-
value = local.automq_ops_bucket
69+
value = local.automq_ops_bucket
7070
}
7171

7272
/*

variables.tf

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ variable "automq_byoc_ec2_instance_type" {
5757
variable "automq_byoc_env_version" {
5858
description = "Set the version for the AutoMQ BYOC environment console. It is recommended to keep the default value, which is the latest version. Historical release note reference [document](https://docs.automq.com/automq-cloud/release-notes)."
5959
type = string
60-
default = "7.5.1"
60+
default = "7.7.1"
6161
}
6262

6363
variable "automq_byoc_env_console_key_name" {
@@ -78,8 +78,15 @@ variable "automq_byoc_env_console_ami" {
7878
default = ""
7979
}
8080

81+
8182
variable "automq_enviroment_console_init" {
8283
description = "Controls the environment console initialization. When false, manual initialization is required. Default is true."
8384
type = bool
8485
default = true
85-
}
86+
}
87+
88+
variable "additional_tags" {
89+
description = "Additional tags to apply to all resources created by this module."
90+
type = map(string)
91+
default = {}
92+
}

versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 5.30"
7+
version = ">= 6.0"
88
}
99
}
1010
}

0 commit comments

Comments
 (0)