Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as codepipeline from 'aws-cdk-lib/aws-codepipeline';
import * as s3 from 'aws-cdk-lib/aws-s3';
import { App, RemovalPolicy, SecretValue, Stack } from 'aws-cdk-lib';
import * as cpactions from 'aws-cdk-lib/aws-codepipeline-actions';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';

const app = new App({
postCliContext: {
Expand Down Expand Up @@ -50,4 +51,7 @@ new codepipeline.Pipeline(stack, 'Pipeline', {
],
});

app.synth();
new IntegTest(app, 'integ.pipeline-alexa-deploy', {
testCases: [stack],
regions: ['us-east-1', 'us-west-2', 'eu-west-1'], // AlexaSkillsKit only available in major regions
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const app = new cdk.App();
const stack = new cdk.Stack(app, 'codepipeline-ecr-build-and-publish-private');

// Make sure you specify your connection ARN, your repository owner and name.
const connectionArn = process.env.CONNECTION_ARN || 'MOCK';
const connectionArn = process.env.CONNECTION_ARN || 'arn:aws:codestar-connections:us-east-1:123456789012:connection/mock-connection-id';
const owner = process.env.REPO_OWNER || 'MOCK';
const repo = process.env.REPO_NAME || 'MOCK';
if (connectionArn === 'MOCK') {
if (connectionArn.includes('mock-connection-id')) {
cdk.Annotations.of(stack).addWarningV2('integ:connection-arn', 'You must specify your connection ARN in the CONNECTION_ARN environment variable');
}
if (owner === 'MOCK') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const app = new cdk.App();
const stack = new cdk.Stack(app, 'codepipeline-ecr-build-and-publish-public');

// Make sure you specify your connection ARN, your repository owner and name.
const connectionArn = process.env.CONNECTION_ARN || 'MOCK';
const connectionArn = process.env.CONNECTION_ARN || 'arn:aws:codestar-connections:us-east-1:123456789012:connection/mock-connection-id';
const owner = process.env.REPO_OWNER || 'MOCK';
const repo = process.env.REPO_NAME || 'MOCK';
if (connectionArn === 'MOCK') {
if (connectionArn.includes('mock-connection-id')) {
cdk.Annotations.of(stack).addWarningV2('integ:connection-arn', 'You must specify your connection ARN in the CONNECTION_ARN environment variable');
}
if (owner === 'MOCK') {
Expand Down Expand Up @@ -74,6 +74,7 @@ const pipeline = new codepipeline.Pipeline(stack, 'Pipeline', {
const integ = new IntegTest(app, 'codepipeline-ecr-build-and-publish-public-test', {
testCases: [stack],
diffAssets: true,
regions: ['us-east-1'], // ECR public repo must be in us-east-1
hooks: {
postDeploy: [
`aws ecr-public delete-repository --repository-name ${repositoryName} --force`,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@
"VpcPublicSubnet1Subnet5C2D37C4": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"VpcId": {
"Ref": "Vpc8378EB38"
},
"AvailabilityZone": {
"Fn::Select": [
0,
Expand All @@ -186,21 +183,24 @@
"Key": "Name",
"Value": "EcsStackDeployedInPipeline/Vpc/PublicSubnet1"
}
]
],
"VpcId": {
"Ref": "Vpc8378EB38"
}
}
},
"VpcPublicSubnet1RouteTable6C95E38E": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "Vpc8378EB38"
},
"Tags": [
{
"Key": "Name",
"Value": "EcsStackDeployedInPipeline/Vpc/PublicSubnet1"
}
]
],
"VpcId": {
"Ref": "Vpc8378EB38"
}
}
},
"VpcPublicSubnet1RouteTableAssociation97140677": {
Expand All @@ -217,12 +217,12 @@
"VpcPublicSubnet1DefaultRoute3DA9E72A": {
"Type": "AWS::EC2::Route",
"Properties": {
"RouteTableId": {
"Ref": "VpcPublicSubnet1RouteTable6C95E38E"
},
"DestinationCidrBlock": "0.0.0.0/0",
"GatewayId": {
"Ref": "VpcIGWD7BA715C"
},
"RouteTableId": {
"Ref": "VpcPublicSubnet1RouteTable6C95E38E"
}
},
"DependsOn": [
Expand All @@ -244,29 +244,30 @@
"VpcPublicSubnet1NATGateway4D7517AA": {
"Type": "AWS::EC2::NatGateway",
"Properties": {
"SubnetId": {
"Ref": "VpcPublicSubnet1Subnet5C2D37C4"
},
"AllocationId": {
"Fn::GetAtt": [
"VpcPublicSubnet1EIPD7E02669",
"AllocationId"
]
},
"SubnetId": {
"Ref": "VpcPublicSubnet1Subnet5C2D37C4"
},
"Tags": [
{
"Key": "Name",
"Value": "EcsStackDeployedInPipeline/Vpc/PublicSubnet1"
}
]
}
},
"DependsOn": [
"VpcPublicSubnet1DefaultRoute3DA9E72A",
"VpcPublicSubnet1RouteTableAssociation97140677"
]
},
"VpcPrivateSubnet1Subnet536B997A": {
"Type": "AWS::EC2::Subnet",
"Properties": {
"VpcId": {
"Ref": "Vpc8378EB38"
},
"AvailabilityZone": {
"Fn::Select": [
0,
Expand All @@ -290,21 +291,24 @@
"Key": "Name",
"Value": "EcsStackDeployedInPipeline/Vpc/PrivateSubnet1"
}
]
],
"VpcId": {
"Ref": "Vpc8378EB38"
}
}
},
"VpcPrivateSubnet1RouteTableB2C5B500": {
"Type": "AWS::EC2::RouteTable",
"Properties": {
"VpcId": {
"Ref": "Vpc8378EB38"
},
"Tags": [
{
"Key": "Name",
"Value": "EcsStackDeployedInPipeline/Vpc/PrivateSubnet1"
}
]
],
"VpcId": {
"Ref": "Vpc8378EB38"
}
}
},
"VpcPrivateSubnet1RouteTableAssociation70C59FA6": {
Expand All @@ -321,12 +325,12 @@
"VpcPrivateSubnet1DefaultRouteBE02A9ED": {
"Type": "AWS::EC2::Route",
"Properties": {
"RouteTableId": {
"Ref": "VpcPrivateSubnet1RouteTableB2C5B500"
},
"DestinationCidrBlock": "0.0.0.0/0",
"NatGatewayId": {
"Ref": "VpcPublicSubnet1NATGateway4D7517AA"
},
"RouteTableId": {
"Ref": "VpcPrivateSubnet1RouteTableB2C5B500"
}
}
},
Expand All @@ -344,11 +348,11 @@
"VpcVPCGWBF912B6E": {
"Type": "AWS::EC2::VPCGatewayAttachment",
"Properties": {
"VpcId": {
"Ref": "Vpc8378EB38"
},
"InternetGatewayId": {
"Ref": "VpcIGWD7BA715C"
},
"VpcId": {
"Ref": "Vpc8378EB38"
}
}
},
Expand Down Expand Up @@ -388,7 +392,10 @@
"TaskDefinition": {
"Ref": "TaskDefinitionB36D86D9"
}
}
},
"DependsOn": [
"TaskDefinitionTaskRoleFD40A61D"
]
},
"EcsServiceSecurityGroup8FDFD52F": {
"Type": "AWS::EC2::SecurityGroup",
Expand All @@ -404,12 +411,47 @@
"VpcId": {
"Ref": "Vpc8378EB38"
}
}
},
"DependsOn": [
"TaskDefinitionTaskRoleFD40A61D"
]
}
},
"Parameters": {
"TaskDefinitionAppContainerImageTagParam6DBCD720": {
"Type": "String"
},
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading