Articles → AWS → Tag Based Policy In AWS
Tag Based Policy In AWS
Steps
- Create a policy
- Create a user
- Create 2 DB instances
- Apply tags on the databases
- Test the policy
Create A Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"rds:DescribeDBInstances",
"rds:DescribeDBClusters",
"rds:DescribeGlobalClusters"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"rds:RebootDBInstance",
"rds:StartDBInstance",
"rds:StopDBInstance"
],
"Resource": "*",
"Condition": {
"StringEquals": {
"rds:db-tag/Environment": "Production"
}
}
}
]
}
Click to Enlarge
Create A User
Click to Enlarge
Create 2 DB Instances
Click to Enlarge
Apply Tags On The Databases
Click to Enlarge
Click to Enlarge
Test The Policy
Click to Enlarge
Click to Enlarge