Skip to content

Commit

Permalink
support multiple instances
Browse files Browse the repository at this point in the history
  • Loading branch information
luisffc committed Oct 16, 2023
1 parent 42fd413 commit ec59d74
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions pipelines/ec2/describe_ec2_instances.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,25 @@ pipeline "describe_ec2_instances" {
default = var.aws_secret_access_key
}

param "instance_id" {
param "instance_ids" {
type = list(string)
}

param "filter" {
type = string
optional = true
}

step "container" "container_run_aws" {
image = "amazon/aws-cli"
cmd = ["ec2", "describe-instances", "--instance-ids", param.instance_id]

cmd = concat([
"ec2",
"describe-instances",
## TODO next step is to only include instance-ids if any are provided
"--instance-ids",
], param.instance_ids)

env = {
AWS_REGION = param.aws_region
AWS_ACCESS_KEY_ID = param.aws_access_key_id
Expand All @@ -34,7 +46,7 @@ pipeline "describe_ec2_instances" {
output "stdout" {
value = step.container.container_run_aws.stdout
}
output "stderr" {
output "stderr" {
value = step.container.container_run_aws.stderr
}
}

0 comments on commit ec59d74

Please sign in to comment.