title: Adding a condition in an AWS policy using the name of the CloudFormation stacks
body: <p>I am writing a policy for a user on AWS so that it can do whatever it want with stacks that have a stack name containing <code>foo</code>. I have looked at the documentation and found information about the <code>Condition</code> value but I did not find how to use the name of the stack in it.</p>
  
  <p>My policy currently looks like that:</p>
  
  <pre><code>{
      "Version": "2012-10-17",
      "Statement": [
          {
              "Sid": "private value",
              "Effect": "Allow",
              "Action": [
                  "cloudformation:*"
              ],
              "Resource": [
                  "*"
              ],
              "Condition": {
                  "StringLike": {
                      "I do not know what to write here": "foo"
                  }
              }
          }
      ]
  }
  </code></pre>
  
  <p>The AWS documentation is hard to use, I know what I should do if I was working with <a href="http://docs.aws.amazon.com/AmazonS3/latest/dev/amazon-s3-policy-keys.html" rel="nofollow noreferrer">s3 buckets</a> but not for CloudFormation stacks.</p>