Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (!props.target.connections.defaultPort) {
throw new Error('The `target` connections must have a default port range.');
}
const rotationFunctionName = this.node.uniqueId;
const securityGroup = new ec2.SecurityGroup(this, 'SecurityGroup', {
vpc: props.vpc
});
const { subnetIds } = props.vpc.selectSubnets(props.vpcSubnets);
props.target.connections.allowDefaultPortFrom(securityGroup);
const application = new serverless.CfnApplication(this, 'Resource', {
location: props.application,
parameters: {
endpoint: `https://secretsmanager.${Stack.of(this).region}.${Stack.of(this).urlSuffix}`,
functionName: rotationFunctionName,
vpcSecurityGroupIds: securityGroup.securityGroupId,
vpcSubnetIds: subnetIds.join(',')
}
});
// Dummy import to reference this function in the rotation schedule
const rotationLambda = lambda.Function.fromFunctionArn(this, 'RotationLambda', Stack.of(this).formatArn({
service: 'lambda',
resource: 'function',
sep: ':',
resourceName: rotationFunctionName
}));
constructor(scope: cdk.Construct, id: string) {
super(scope, id)
new CfnApplication(scope, `${id}App`, {
location: {
applicationId:
'arn:aws:serverlessrepo:us-east-1:923120264911:applications/pipeline-dashboard',
semanticVersion: '0.0.7'
},
parameters: {
PipelinePattern: '*'
}
})
}
}