Skip to content

Commit

Permalink
Fix param and step name references
Browse files Browse the repository at this point in the history
  • Loading branch information
cbruno10 committed Oct 16, 2023
1 parent bd41aea commit c1c6f1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions pipelines/ec2/describe_ec2_instances.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pipeline "describe_ec2_instances" {

cmd = concat(
["ec2", "describe-instances"],
param.instance_ids != null && length(param.instance_ids) > 0 ? concat(["--instance-ids"], param.instance_ids) : [],
param.instance_ids != null && try(length(param.instance_ids), 0) > 0 ? concat(["--instance-ids"], param.instance_ids) : [],
param.instance_type != null ? ["--filters", "Name=instance-type,Values=${param.instance_type}"] : [],
param.ebs_optimized != null ? ["--filters", "Name=ebs-optimized,Values=${param.ebs_optimized}"] : []
)
Expand All @@ -54,10 +54,10 @@ pipeline "describe_ec2_instances" {
}

output "stdout" {
value = jsondecode(step.container.container_run_aws.stdout)
value = jsondecode(step.container.describe_ec2_instances.stdout)
}

output "stderr" {
value = jsondecode(step.container.container_run_aws.stderr)
value = jsondecode(step.container.describe_ec2_instances.stderr)
}
}
10 changes: 5 additions & 5 deletions pipelines/ec2/start_ec2_instance.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ pipeline "start_ec2_instance" {
image = "amazon/aws-cli"
cmd = ["ec2", "start-instances", "--instance-ids", param.instance_id]
env = {
AWS_REGION = param.aws_region
AWS_ACCESS_KEY_ID = param.aws_access_key_id
AWS_SECRET_ACCESS_KEY = param.aws_secret_access_key
AWS_REGION = param.region
AWS_ACCESS_KEY_ID = param.access_key_id
AWS_SECRET_ACCESS_KEY = param.secret_access_key
}
}

output "stdout" {
value = step.container.container_run_aws.stdout
value = step.container.start_ec2_instance.stdout
}

output "stderr" {
value = step.container.container_run_aws.stderr
value = step.container.start_ec2_instance.stderr
}
}

0 comments on commit c1c6f1c

Please sign in to comment.