0

If I add a tag to a codecommit repo with code commit => the repo => Settings => repository tags => add tags how do i reference this tag in IAM

I have in the policy document a statment i am trying to use to reference the tag Im not sure what i use in the resource section to refrence a tag I add.

statement { sid = "AllowCodeCommitAccess" actions = [ "codecommit:GitPull", ] resources = ["?????????"] }

Also I haven't actually added the tag yet to codecommit repo as something on aws said it could impact access. I assume that just means If IAM uses it to denny resources but wasn't %100 sure and haven't added it yet.

1

I found what i needed to allow or the eqivalent StringNotEquals to deny useing the tag aws:ResourceTag

"Condition": {
                "StringEquals": {
                    "aws:ResourceTag/Key_-1": "Value_-1"
                }
            }
| improve this answer | |
0

Honestly, I'm confused your question. It's meant to prevent git pull IAM user for specific repository or something else?

Here is example of how to deny policy for specific repository that can be attached to your IAM users.

{
  "Version": "2012-10-17",
  "Statement" : [
    {
      "Effect" : "Deny",
      "Action" : [
        "codecommit:*"
      ],
      "Resource" : [
        "arn:aws:codecommit:us-east-2:111111111111:myrepo"
      ]
    }
  ]
}
| improve this answer | |
  • To allow or deny permitions based on tags added to the repos so the tags can then be used to determin the repos diffrent groups of users have what access – doug May 12 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.