https://github.com/saoudrizwan/ec2-get-tag
https://github.com/saoudrizwan/ec2-get-tag
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/saoudrizwan/ec2-get-tag
- Owner: saoudrizwan
- Created: 2019-09-26T19:58:14.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-26T20:44:47.000Z (almost 7 years ago)
- Last Synced: 2025-01-20T09:26:23.826Z (over 1 year ago)
- Language: Shell
- Size: 2.93 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ec2-get-tag
`ec2-get-tag` is a one-liner that retrieves the value of a tag you set on your EC2 instance.
### 1. First add the following IAM policy to your EC2 instance:
```json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:DescribeTags",
"Resource": "*"
}
]
}
```
### 2. Now you can execute the following
```bash
curl -s https://raw.githubusercontent.com/saoudrizwan/ec2-get-tag/1.0/ec2-get-tag.sh | bash -s TAGNAME
```
## Sources
- https://priocept.com/2017/02/14/aws-tag-retrieval-from-within-an-ec2-instance/
- https://marcelog.github.io/articles/aws_get_tags_from_inside_instance_ec2.html