Skip to content

Commit

Permalink
Merge branch 'add-websocket-iam-authorizer' of github.com:d0z0/aws-cd…
Browse files Browse the repository at this point in the history
…k into add-websocket-iam-authorizer
  • Loading branch information
d0z0 committed Aug 4, 2022
2 parents 8dbb8f5 + 50a7a2a commit 0c6890a
Show file tree
Hide file tree
Showing 109 changed files with 6,870 additions and 604 deletions.
17 changes: 0 additions & 17 deletions .github/semantic.yml

This file was deleted.

11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.10",
"jest-junit": "^13.2.0",
"jsii-diff": "^1.63.0",
"jsii-pacmak": "^1.62.0",
"jsii-reflect": "^1.63.0",
"jsii-rosetta": "^1.63.0",
"jsii-diff": "^1.63.2",
"jsii-pacmak": "^1.63.2",
"jsii-reflect": "^1.63.2",
"jsii-rosetta": "^1.63.2",
"lerna": "^4.0.0",
"patch-package": "^6.4.7",
"semver": "^6.3.0",
Expand All @@ -36,8 +36,7 @@
"resolutions": {
"colors": "1.4.0",
"markdown-it": "^12.3.2",
"string-width": "^4.2.3",
"jsii-pacmak": "1.62.0"
"string-width": "^4.2.3"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-appmesh/lib/route-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ function renderWeightedTargets(weightedTargets: WeightedTarget[]): CfnRoute.Weig
for (const t of weightedTargets) {
renderedTargets.push({
virtualNode: t.virtualNode.virtualNodeName,
weight: t.weight || 1,
weight: t.weight == undefined ? 1 : t.weight,
});
}
return renderedTargets;
Expand Down
71 changes: 71 additions & 0 deletions packages/@aws-cdk/aws-appmesh/test/route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,77 @@ describe('route', () => {
});
});

test('should allow zero weight route', () => {
// GIVEN
const stack = new cdk.Stack();
const mesh = new appmesh.Mesh(stack, 'mesh', {
meshName: 'test-mesh',
});

const router = new appmesh.VirtualRouter(stack, 'router', {
mesh,
});

const virtualNode = mesh.addVirtualNode('test-node', {
serviceDiscovery: appmesh.ServiceDiscovery.dns('test'),
listeners: [appmesh.VirtualNodeListener.http()],
});

// WHEN
router.addRoute('http2', {
routeSpec: appmesh.RouteSpec.http2({
priority: 50,
weightedTargets: [
{
virtualNode: virtualNode,
weight: 0,
},
],
}),
});
router.addRoute('http', {
routeSpec: appmesh.RouteSpec.http({
priority: 10,
weightedTargets: [
{
virtualNode: virtualNode,
weight: 0,
},
],
}),
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::AppMesh::Route', {
Spec: {
Priority: 50,
Http2Route: {
Action: {
WeightedTargets: [
{
Weight: 0,
},
],
},
},
},
});
Template.fromStack(stack).hasResourceProperties('AWS::AppMesh::Route', {
Spec: {
Priority: 10,
HttpRoute: {
Action: {
WeightedTargets: [
{
Weight: 0,
},
],
},
},
},
});
});

test('Can import Routes using an ARN', () => {
const app = new cdk.App();
// GIVEN
Expand Down
7 changes: 7 additions & 0 deletions packages/@aws-cdk/aws-ec2/lib/vpc-endpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,14 @@ export class InterfaceVpcEndpointService implements IInterfaceVpcEndpointService
export class InterfaceVpcEndpointAwsService implements IInterfaceVpcEndpointService {
public static readonly SAGEMAKER_NOTEBOOK = new InterfaceVpcEndpointAwsService('notebook', 'aws.sagemaker');
public static readonly ATHENA = new InterfaceVpcEndpointAwsService('athena');
public static readonly APPLICATION_AUTOSCALING = new InterfaceVpcEndpointAwsService('application-autoscaling');
public static readonly AUTOSCALING = new InterfaceVpcEndpointAwsService('autoscaling');
public static readonly AUTOSCALING_PLANS = new InterfaceVpcEndpointAwsService('autoscaling-plans');
public static readonly BATCH = new InterfaceVpcEndpointAwsService('batch');
public static readonly CLOUDFORMATION = new InterfaceVpcEndpointAwsService('cloudformation');
public static readonly CLOUDTRAIL = new InterfaceVpcEndpointAwsService('cloudtrail');
public static readonly CODEARTIFACT_API = new InterfaceVpcEndpointAwsService('codeartifact.api');
public static readonly CODEARTIFACT_REPOSITORIES = new InterfaceVpcEndpointAwsService('codeartifact.repositories');
public static readonly CODEBUILD = new InterfaceVpcEndpointAwsService('codebuild');
public static readonly CODEBUILD_FIPS = new InterfaceVpcEndpointAwsService('codebuild-fips');
public static readonly CODECOMMIT = new InterfaceVpcEndpointAwsService('codecommit');
Expand Down Expand Up @@ -294,6 +300,7 @@ export class InterfaceVpcEndpointAwsService implements IInterfaceVpcEndpointServ
public static readonly CLOUDWATCH = new InterfaceVpcEndpointAwsService('monitoring');
public static readonly RDS = new InterfaceVpcEndpointAwsService('rds');
public static readonly RDS_DATA = new InterfaceVpcEndpointAwsService('rds-data');
public static readonly S3 = new InterfaceVpcEndpointAwsService('s3');
public static readonly SAGEMAKER_API = new InterfaceVpcEndpointAwsService('sagemaker.api');
public static readonly SAGEMAKER_RUNTIME = new InterfaceVpcEndpointAwsService('sagemaker.runtime');
public static readonly SAGEMAKER_RUNTIME_FIPS = new InterfaceVpcEndpointAwsService('sagemaker.runtime-fips');
Expand Down
7 changes: 7 additions & 0 deletions packages/@aws-cdk/aws-ec2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,17 @@
"docs-public-apis:@aws-cdk/aws-ec2.GatewayVpcEndpointAwsService.DYNAMODB",
"docs-public-apis:@aws-cdk/aws-ec2.GatewayVpcEndpointAwsService.S3",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.APIGATEWAY",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.APPLICATION_AUTOSCALING",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.AUTOSCALING",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.AUTOSCALING_PLANS",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.ATHENA",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.CLOUDFORMATION",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.CLOUDTRAIL",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.CLOUDWATCH",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.CLOUDWATCH_EVENTS",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.CLOUDWATCH_LOGS",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.CODEARTIFACT_API",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.CODEARTIFACT_REPOSITORIES",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.CODEBUILD",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.CODEBUILD_FIPS",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.CODECOMMIT",
Expand All @@ -276,6 +281,7 @@
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.CODEGURU_REVIEWER",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.CODEPIPELINE",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.CONFIG",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.BATCH",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.EC2",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.EC2_MESSAGES",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.ECR",
Expand All @@ -294,6 +300,7 @@
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.KMS",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.RDS",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.RDS_DATA",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.S3",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.SAGEMAKER_API",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.SAGEMAKER_NOTEBOOK",
"docs-public-apis:@aws-cdk/aws-ec2.InterfaceVpcEndpointAwsService.SAGEMAKER_RUNTIME",
Expand Down
6 changes: 6 additions & 0 deletions packages/@aws-cdk/aws-ec2/test/cfn-init-element.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ describe('InitFile', () => {
const content = {
version: '1234',
secretsFile: '/tmp/secrets',
maxThreads: 15,
isEnabled: true,
floatNumber: 23.18,
};
const file = ec2.InitFile.fromObject('/tmp/foo', content);

Expand All @@ -276,6 +279,9 @@ describe('InitFile', () => {
content: {
version: '1234',
secretsFile: '/tmp/secrets',
maxThreads: 15,
isEnabled: true,
floatNumber: 23.18,
},
owner: 'root',
group: 'root',
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"17.0.0"}
{"version":"20.0.0"}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.0",
"version": "20.0.0",
"files": {
"f8a1af398dac2fad92eeea4fb7620be1c4f504e23e3bfcd859fbb5744187930b": {
"source": {
Expand All @@ -14,15 +14,15 @@
}
}
},
"6d00e54104832c562dc7d659fc2df0a5a8d096d46d6d3ab8bf79c3fb5759a13e": {
"e62e8b1ed4fd967ec674edc5d686a08042183fd4164dd2f026c1e4f56835a6f3": {
"source": {
"path": "integ-init.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "6d00e54104832c562dc7d659fc2df0a5a8d096d46d6d3ab8bf79c3fb5759a13e.json",
"objectKey": "e62e8b1ed4fd967ec674edc5d686a08042183fd4164dd2f026c1e4f56835a6f3.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@
]
}
},
"Instance255F352651ad64873f230a4d2": {
"Instance255F35265555f8bd64fe3316f": {
"Type": "AWS::EC2::Instance",
"Properties": {
"AvailabilityZone": {
Expand Down Expand Up @@ -555,23 +555,23 @@
"Fn::Join": [
"",
[
"#!/bin/bash\n# fingerprint: 8ef54c03058b2a11\n(\n set +e\n /opt/aws/bin/cfn-init -v --region ",
"#!/bin/bash\n# fingerprint: 8deb3fafcf9d33f0\n(\n set +e\n /opt/aws/bin/cfn-init -v --region ",
{
"Ref": "AWS::Region"
},
" --stack ",
{
"Ref": "AWS::StackName"
},
" --resource Instance255F352651ad64873f230a4d2 -c default\n /opt/aws/bin/cfn-signal -e $? --region ",
" --resource Instance255F35265555f8bd64fe3316f -c default\n /opt/aws/bin/cfn-signal -e $? --region ",
{
"Ref": "AWS::Region"
},
" --stack ",
{
"Ref": "AWS::StackName"
},
" --resource Instance255F352651ad64873f230a4d2\n cat /var/log/cfn-init.log >&2\n)"
" --resource Instance255F35265555f8bd64fe3316f\n cat /var/log/cfn-init.log >&2\n)"
]
]
}
Expand Down Expand Up @@ -668,15 +668,18 @@
}
},
"files": {
"/tmp/file2": {
"/tmp/file2.json": {
"content": {
"stackId": {
"Ref": "AWS::StackId"
},
"stackName": "integ-init",
"region": {
"Ref": "AWS::Region"
}
},
"intProperty": 18,
"boolProperty": true,
"numProperty": 58.23
},
"mode": "000644",
"owner": "root",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "17.0.0",
"version": "20.0.0",
"artifacts": {
"Tree": {
"type": "cdk:tree",
Expand Down Expand Up @@ -194,7 +194,7 @@
"/integ-init/Instance2/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "Instance255F352651ad64873f230a4d2"
"data": "Instance255F35265555f8bd64fe3316f"
}
],
"/integ-init/SsmParameterValue:--aws--service--ami-amazon-linux-latest--amzn-ami-hvm-x86_64-gp2:C96584B6-F00A-464E-AD19-53AFF4B05118.Parameter": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"path": "Tree",
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.58"
}
},
"integ-init": {
Expand Down Expand Up @@ -900,23 +900,23 @@
"Fn::Join": [
"",
[
"#!/bin/bash\n# fingerprint: 8ef54c03058b2a11\n(\n set +e\n /opt/aws/bin/cfn-init -v --region ",
"#!/bin/bash\n# fingerprint: 8deb3fafcf9d33f0\n(\n set +e\n /opt/aws/bin/cfn-init -v --region ",
{
"Ref": "AWS::Region"
},
" --stack ",
{
"Ref": "AWS::StackName"
},
" --resource Instance255F352651ad64873f230a4d2 -c default\n /opt/aws/bin/cfn-signal -e $? --region ",
" --resource Instance255F35265555f8bd64fe3316f -c default\n /opt/aws/bin/cfn-signal -e $? --region ",
{
"Ref": "AWS::Region"
},
" --stack ",
{
"Ref": "AWS::StackName"
},
" --resource Instance255F352651ad64873f230a4d2\n cat /var/log/cfn-init.log >&2\n)"
" --resource Instance255F35265555f8bd64fe3316f\n cat /var/log/cfn-init.log >&2\n)"
]
]
}
Expand Down Expand Up @@ -1011,13 +1011,13 @@
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.58"
}
}
},
"constructInfo": {
"fqn": "constructs.Construct",
"version": "10.0.9"
"version": "10.1.58"
}
}
},
Expand Down
5 changes: 4 additions & 1 deletion packages/@aws-cdk/aws-ec2/test/integ.instance-init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,13 @@ new ec2.Instance(stack, 'Instance2', {
ec2.InitPackage.yum('git'),
]),
config: new ec2.InitConfig([
ec2.InitFile.fromObject('/tmp/file2', {
ec2.InitFile.fromObject('/tmp/file2.json', {
stackId: stack.stackId,
stackName: stack.stackName,
region: stack.region,
intProperty: 18,
boolProperty: true,
numProperty: 58.23,
}),
ec2.InitGroup.fromName('group1'),
ec2.InitGroup.fromName('group2', 42),
Expand Down
Loading

0 comments on commit 0c6890a

Please sign in to comment.