Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag Elastic Beanstalk EBS volumes #152

Merged
merged 1 commit into from
Jan 20, 2022
Merged

Conversation

hayd
Copy link
Contributor

@hayd hayd commented Aug 11, 2021

Adds a community provided .config file to tag instance volumes created by Elastic Beanstalk.

Note: This is a slightly amended version of one provided to me by AWS Support (by Arpit C).


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@nikhil-swamix
Copy link

this is a static code, does not apply for other users who have different ips...

@hayd
Copy link
Contributor Author

hayd commented Sep 30, 2021

this is a static code, does not apply for other users who have different ips...

huh? which part are you suggesting is problematic?

@nikhil-swamix
Copy link

this is a static code, does not apply for other users who have different ips...

huh? which part are you suggesting is problematic?

[root@ip-111-111-256-256 ec2-user]# 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)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11 100 11 0 0 5500 0 --:--:-- --:--:-- --:--:-- 5500
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 19 100 19 0 0 6333 0 --:--:-- --:--:-- --:--:-- 6333
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 11 100 11 0 0 11000 0 --:--:-- --:--:-- --:--:-- 11000

An error occurred (UnauthorizedOperation) when calling the CreateTags operation: You are not authorized to perform this operation. Encoded authorization failure message: ZibJoO53MXrm-HKVWcKkk8wdshbIYlUXNl5AhhYMjbtl7sdciRtTpBUYNrEI_rfjIkLvHm9EFlHIJZ1HKfhPLYL50Cpqf4PYo26q3U0pbn2GZA7cZrXuuy4bedZ-1-2bXZMokevgzQ7NYw5L4IWhtgEPJ2GTeIV5IUmyXySmyN_x2qUJcDQvEx-ylsjoVivrjQXus6oVURttjI71QwXDV3niL3eHHQvoMVMCRyL3NWXvw5YTcRChGK8OpHfpizsCn1ilBbsF5quQ2xEerUwhjWKjUwUMAG_wJV-fEgHOhInAHRNszxyGjITr7aUdXQV2FhNBP3KjVJhS-LM5ai-W7OlsUXqkX1gnDakxpeRLH9iWd3kM5iWu6HmYT94xoiYbtK6uiswEb_XzG0qnfnIJdSexyd62BMbd6EREAQ8-1tYLMvTWASR_zZokW7bZ6hAwiJBEelbT2jjNFooe54gZ0xzXoMf_GHlPASBS8JuwRLTI8vainkU1djVa7W_nwdG5R2uuXWP3G1uakQUfkujaKYzSjzbntY4DvLeBMbcmzE5TjAx0luat2xZjKkCMdqutM_f54p-cmiIbefS43y1jrnj69nOtP8gYqzU2-UitSR3HlMUtcN5P7NGw9xq_hmb8r4W6Vm-a_nOFbmyONZ1DdQt7L-nKPlndMGY-vSidoJ2zZMuwGWIod_sAmdgM2zIp51tTcSJdqvju

@hayd
Copy link
Contributor Author

hayd commented Sep 30, 2021

See the README:

#### This requires that the IAM role have EC2 Create Tag and EC2 Describe permissions since the
#### volume is tagged by the instance (as opposed to the service/service role).

@mrenneke-amazon
Copy link
Collaborator

Thank you for contributing! Merging now.

@mrenneke-amazon mrenneke-amazon merged commit 2869b7b into awsdocs:main Jan 20, 2022
@hayd hayd deleted the patch-2 branch January 20, 2022 18:26
@hayd
Copy link
Contributor Author

hayd commented Feb 5, 2022

Note: This .config requires Disable IMDSv1 setting be set to "false".

It would be nice to rewrite it slightly so it doesn't!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants