{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ListDistributions",
      "Effect": "Allow",
      "Action": "cloudfront:ListDistributions",
      "Resource": "*"
    },
    {
      "Sid": "SelectedDistribution",
      "Effect": "Allow",
      "Action": [
        "cloudfront:GetDistribution",
        "cloudfront:GetDistributionConfig",
        "cloudfront:UpdateDistribution"
      ],
      "Resource": "arn:aws:cloudfront::YOUR_AWS_ACCOUNT_ID:distribution/YOUR_DISTRIBUTION_ID"
    },
    {
      "Sid": "ReadImportedCertificates",
      "Effect": "Allow",
      "Action": [
        "acm:DescribeCertificate",
        "acm:GetCertificate",
        "acm:ListTagsForCertificate"
      ],
      "Resource": "arn:aws:acm:us-east-1:YOUR_AWS_ACCOUNT_ID:certificate/*"
    },
    {
      "Sid": "ImportTaggedCertificate",
      "Effect": "Allow",
      "Action": [
        "acm:ImportCertificate",
        "acm:AddTagsToCertificate"
      ],
      "Resource": "*",
      "Condition": {
        "StringLike": {
          "aws:RequestTag/qwac-endpoint": "*"
        },
        "StringEquals": {
          "aws:RequestedRegion": "us-east-1"
        }
      }
    },
    {
      "Sid": "ReimportManagedCertificate",
      "Effect": "Allow",
      "Action": "acm:ImportCertificate",
      "Resource": "arn:aws:acm:us-east-1:YOUR_AWS_ACCOUNT_ID:certificate/*",
      "Condition": {
        "StringLike": {
          "aws:ResourceTag/qwac-endpoint": "*"
        }
      }
    }
  ]
}
