File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 1+ ###################################################################################################
2+ #### Tag EBS volume Name with the Elastic Beanstalk environment name. This is the same naming
3+ #### convention used on the instances to which the volumes are attached. Without this config
4+ #### Elastic Beanstalk leaves the volume Name tag empty.
5+ #### This requires that the IAM role have EC2 Create Tag and EC2 Describe permissions since the
6+ #### volume is tagged by the instance (as opposed to the service/service role).
7+ ####
8+ #### Note: According to support this is "an ongoing feature request to add support for tagging EBS
9+ #### volume by allowing the Resource tags to be propagated to the Launch Template".
10+ #### Which is to say: hopefully this will not be required at some point in future.
11+ ####
12+ #### Author: @hayd
13+ ###################################################################################################
14+
15+ container_commands:
16+ tagVolume:
17+ command: aws ec2 create-tags --resources $(aws ec2 describe-instances --region $(curl http://169.254.169.254/latest/meta-data/placement/availability-zone| sed 's/[a-z]$//') --instance-id $(curl http://169.254.169.254/latest/meta-data/instance-id ) --output text --query Reservations[0].Instances[0].BlockDeviceMappings[0].Ebs.VolumeId) --region $(curl http://169.254.169.254/latest/meta-data/placement/availability-zone| sed 's/[a-z]$//') --tags Key=Name,Value=$(/opt/elasticbeanstalk/bin/get-config container -k environment_name)
You can’t perform that action at this time.
0 commit comments