I’m try to create a service role for AWS CodeBuild. I can create a role like this: Now I need to attach the Amazon-provided AWSCodeBuildAdminAccess policy to the role. How can I do this using the CDK? Answer You can get access to the policy like this: And attach it to your role like this:
Tag: amazon-iam
AWS CDK How to include principals in IAM policy?
Hi I am working on AWS CDK. I am trying to create resource based policy. Below is my cloud formation template. Below I am trying to create same using CDK. This results in below error Error: Expected object reference, got “arn:aws:iam::123:root” Can someone help me to write correct syntax using python? Any help would be appreciated. Thanks Answer principals needs
How to choose an AWS profile when using boto3 to connect to CloudFront
I am using the Boto 3 python library, and want to connect to AWS CloudFront. I need to specify the correct AWS Profile (AWS Credentials), but looking at the official documentation, I see no way to specify it. I am initializing the client using the code: client = boto3.client(‘cloudfront’) However, this results in it using the default profile to connect.