Skip to content

Commit

Permalink
Merge branch 'staging' of github.com:turbot/flowpipe-mod-aws into sta…
Browse files Browse the repository at this point in the history
…ging
  • Loading branch information
cbruno10 committed Oct 17, 2023
2 parents 39c2343 + 52c4b35 commit 9045400
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pipelines/ec2/modify_rds_db_instance.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,22 @@ 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
}

step "container" "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"] : [],
)

Expand All @@ -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
}
}
52 changes: 52 additions & 0 deletions pipelines/s3/update_s3_bucket_versioning.hcl
Original file line number Diff line number Diff line change
@@ -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)
}
}

0 comments on commit 9045400

Please sign in to comment.