1 Answer
- Newest
- Most votes
- Most comments
0
Did you try something like this:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "cloudformation:*",
"Resource": "*",
"Condition": {
"StringEquals": {
"aws:RequestTag/StackName": "${aws:StackName}"
}
}
}
]
}
Also refer this AWS CloudFormation service role, if it helps.
Comment here if you have additional questions, happy to assist.
Abhishek
Relevant content
- asked 3 years ago
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated a year ago
Sorry, I'm a bit confused. Is
aws:StackName
a policy variable? I'm not seeing that documented anywhere, and it doesn't seem to match any global or CloudFormation-specific single-valued condition keys.aws:StackName is pseudo parameter, which you can use in condition. Refer https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/pseudo-parameter-reference.html. Let me know if you have additional questions.
@secondabhi_aws I don't this pseudo parameters will do what I'm looking for. I'm looking to create a service role to pass to CreateStack/UpdateStack, which needs to be able to do things like manage EC2 instance or SNS topics. A policy like the one in the example only deal with operations on the stack itself. It would also be unusual to create a service role for a stack within the stack itself, since that introduces a bit of a circular dependency.
I could be misunderstanding the intended implementation of this solution, though.
You are absolutely correct, all I am trying to indicate is, you could possibly use this pseudo parameter in your policy condition/boundary, wherever is required.