From 715c71466f3334a6e3518b647e0312d2d37bf5fb Mon Sep 17 00:00:00 2001 From: Graza Date: Tue, 17 Oct 2023 11:39:35 +0800 Subject: [PATCH 1/2] feat: update_s3_bucket_versioning pipeline --- pipelines/s3/update_s3_bucket_versioning.hcl | 52 ++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 pipelines/s3/update_s3_bucket_versioning.hcl diff --git a/pipelines/s3/update_s3_bucket_versioning.hcl b/pipelines/s3/update_s3_bucket_versioning.hcl new file mode 100644 index 0000000..3401bfb --- /dev/null +++ b/pipelines/s3/update_s3_bucket_versioning.hcl @@ -0,0 +1,52 @@ +pipeline "update_s3_bucket_versioning" { + param "region" { + type = string + description = "The name of the Region." + default = var.region + } + + param "access_key_id" { + type = string + description = "The ID for this access key." + default = var.access_key_id + } + + param "secret_access_key" { + type = string + description = "The secret key used to sign requests." + default = var.secret_access_key + } + + param "name" { + type = string + description = "The name of the bucket." + } + + param "versioning" { + type = bool + description = "The versioning state of the bucket." + } + + step "container" "update_s3_bucket_versioning" { + image = "amazon/aws-cli" + + cmd = concat( + ["s3api", "put-bucket-versioning", "--bucket", param.name, "--versioning-configuration"], + param.versioning ? ["Status=Enabled"] : ["Status=Suspended"], + ) + + env = { + AWS_REGION = param.region + AWS_ACCESS_KEY_ID = param.access_key_id + AWS_SECRET_ACCESS_KEY = param.secret_access_key + } + } + + output "stdout" { + value = jsondecode(step.container.update_s3_bucket_versioning.stdout) + } + + output "stderr" { + value = jsondecode(step.container.update_s3_bucket_versioning.stderr) + } +} \ No newline at end of file From 52c4b35616c237a1dc7b622ca5dc69b2dc21e0ad Mon Sep 17 00:00:00 2001 From: luis cavalcante Date: Tue, 17 Oct 2023 11:59:10 +0800 Subject: [PATCH 2/2] rds fixes --- pipelines/ec2/modify_rds_db_instance.hcl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pipelines/ec2/modify_rds_db_instance.hcl b/pipelines/ec2/modify_rds_db_instance.hcl index 168f256..99c797b 100644 --- a/pipelines/ec2/modify_rds_db_instance.hcl +++ b/pipelines/ec2/modify_rds_db_instance.hcl @@ -18,15 +18,14 @@ pipeline "modify_rds_db_instance" { default = var.secret_access_key } - param "instance_identifier" { + param "db_instance_identifier" { type = string - description = "The instance ID." - optional = true + description = "The identifier of DB instance to modify. This value is stored as a lowercase string." } param "publicly_accessible" { type = bool - description = "Whether the DB instance is publicly accessible." + description = "Specifies whether the DB instance is publicly accessible." optional = true } @@ -34,7 +33,7 @@ pipeline "modify_rds_db_instance" { image = "amazon/aws-cli" cmd = concat( - ["rds", "modify-db-instance", "--apply-immediately", "--db-instance-identifier", param.instance_identifier], + ["rds", "modify-db-instance", "--apply-immediately", "--db-instance-identifier", param.db_instance_identifier], param.publicly_accessible != null ? param.publicly_accessible ? ["--publicly-accessible"] : ["--no-publicly-accessible"] : [], ) @@ -50,6 +49,6 @@ pipeline "modify_rds_db_instance" { } output "stderr" { - value = jsondecode(step.container.modify_rds_db_instance.stderr) + value = step.container.modify_rds_db_instance.stderr } }