This repository was archived by the owner on Jan 16, 2025. It is now read-only.
File tree 2 files changed +10
-4
lines changed
2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,15 @@ resource "aws_launch_template" "runner" {
81
81
http_endpoint = metadata_options. value . http_endpoint
82
82
http_tokens = metadata_options. value . http_tokens
83
83
http_put_response_hop_limit = metadata_options. value . http_put_response_hop_limit
84
+ instance_metadata_tags = " enabled"
85
+ }
86
+ }
87
+
88
+ dynamic "metadata_options" {
89
+ for_each = var. metadata_options != null ? [] : [0 ]
90
+
91
+ content {
92
+ instance_metadata_tags = " enabled"
84
93
}
85
94
}
86
95
Original file line number Diff line number Diff line change @@ -11,10 +11,7 @@ echo "Retrieved REGION from AWS API ($region)"
11
11
instance_id=$( curl -f -H " X-aws-ec2-metadata-token: $token " -v http://169.254.169.254/latest/meta-data/instance-id)
12
12
echo " Retrieved INSTANCE_ID from AWS API ($instance_id )"
13
13
14
- tags=$( aws ec2 describe-tags --region " $region " --filters " Name=resource-id,Values=$instance_id " )
15
- echo " Retrieved tags from AWS API ($tags )"
16
-
17
- environment=$( echo " $tags " | jq -r ' .Tags[] | select(.Key == "ghr:environment") | .Value' )
14
+ environment=$( curl -f -H " X-aws-ec2-metadata-token: $token " -v http://169.254.169.254/latest/meta-data/tags/instance/ghr:environment)
18
15
echo " Retrieved ghr:environment tag - ($environment )"
19
16
20
17
parameters=$( aws ssm get-parameters-by-path --path " /$environment /runner" --region " $region " --query " Parameters[*].{Name:Name,Value:Value}" )
You can’t perform that action at this time.
0 commit comments