Can I use SSM parameter in the SCP policy

0

Hi Team, trying to get this work but seems like we can not fetch parameter ( stored in SSM parameter store) from within a SCP policy. I was trying this below policy but seems like this is not effecting as it supposed to be. Any help on this please ? With this policy I would like to restrict vpc creation and cidr association only within the given/allowed ipam pol id.

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Deny", "Action": [ "ec2:CreateVpc", "ec2:AssociateVpcCidrBlock" ], "Resource": "arn:aws:ec2:*:*:vpc/*", "Condition": { "StringNotEquals": { "ec2:Ipv4IpamPoolId": [ "{{resolve:ssm:/test/workload-ipam-pool-id}}", "{{resolve:ssm:/test/transit-gateway-ipam-pool-id}}" ] } } } ]

2回答
1
承認された回答

I don't think this is supported as SSM Parameter Store only supports a number of AWS services which currently doesn't include SCP.

profile pictureAWS
エキスパート
回答済み 1ヶ月前
profile picture
エキスパート
レビュー済み 1ヶ月前
profile picture
エキスパート
レビュー済み 1ヶ月前
0

As commented by the colleague, this scenario is not supported by Service Control Policies. But, what you can do is to deploy the SCP using Automation tools (like CloudFormation or Terraform) and from those tools get the configuration from Parameter Store and build the final SCP. You can also trigger changes, when someone changes that configuration and update the deployed SCP using your pipeline. That's the way to get to do what you are looking for.

Best,

profile pictureAWS
回答済み 1ヶ月前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ