Skip to content

Instantly share code, notes, and snippets.

@KyMidd
Last active May 1, 2023 01:03
Show Gist options
  • Select an option

  • Save KyMidd/e89f46a89b235c6b1834e25cdd4c6b9b to your computer and use it in GitHub Desktop.

Select an option

Save KyMidd/e89f46a89b235c6b1834e25cdd4c6b9b to your computer and use it in GitHub Desktop.
resource "aws_iam_role_policy" "GitHubCopRepoTrigger_ReadSecrets" {
name = "ReadSecret"
role = aws_iam_role.GitHubCopNewRepoTriggerRole.id
policy = jsonencode(
{
"Version" : "2012-10-17",
"Statement" : [
{
"Effect" : "Allow",
"Action" : [
"secretsmanager:GetResourcePolicy",
"secretsmanager:GetSecretValue",
"secretsmanager:DescribeSecret",
"secretsmanager:ListSecretVersionIds"
],
"Resource" : [
var.github_pat_secret_arn,
var.github_webhook_secret_arn
]
},
{
"Effect" : "Allow",
"Action" : [
"kms:Decrypt"
],
"Resource" : [
data.aws_secretsmanager_secret.github_pat_secret_kms_cmk_arn.kms_key_id
]
}
]
}
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment