Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(scope: cdk.App, id: string, props?: cdk.StackProps) {
super(scope, id, props);
// Create a VPC
const vpc = new ec2.Vpc(this, 'CoffeeShopVPC', {
cidr: '10.0.0.0/16',
natGateways: 1
});
this.ecrRepository = new ecr.Repository(this, 'Repository', {
repositoryName: DOCKER_IMAGE_PREFIX,
removalPolicy: cdk.RemovalPolicy.DESTROY
});
const buildRole = new iam.Role(this, 'CodeBuildIamRole', {
assumedBy: new iam.ServicePrincipal('codebuild.amazonaws.com')
});
buildRole.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName("AWSLambdaFullAccess"));
buildRole.addManagedPolicy(iam.ManagedPolicy.fromAwsManagedPolicyName("AmazonAPIGatewayAdministrator"));
buildRole.addToPolicy(new iam.PolicyStatement({
resources: ['*'],
actions: ['cloudformation:*']
}));
buildRole.addToPolicy(new iam.PolicyStatement({
resources: ['*'],