Skip to content

Commit

Permalink
Merge branch 'master' into feat/sqs-batching-window-support
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Mar 26, 2021
2 parents 2876e3b + 88f2c5a commit 10969e2
Show file tree
Hide file tree
Showing 29 changed files with 147 additions and 238 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.95.1](https://github.com/aws/aws-cdk/compare/v1.95.0...v1.95.1) (2021-03-25)


### Bug Fixes

* **codebuild:** module fails to load with error "Cannot use import statement outside a module" ([b1ffd33](https://github.com/aws/aws-cdk/commit/b1ffd335b6c41a26c1f88db2fc5a739c4c18c7fe)), closes [#13699](https://github.com/aws/aws-cdk/issues/13699) [#13699](https://github.com/aws/aws-cdk/issues/13699)

## [1.95.0](https://github.com/aws/aws-cdk/compare/v1.94.1...v1.95.0) (2021-03-25)


Expand Down
12 changes: 0 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@
"nohoist": [
"**/jszip",
"**/jszip/**",
"@aws-cdk/aws-codebuild/@aws-cdk/yaml-cfn",
"@aws-cdk/aws-codebuild/@aws-cdk/yaml-cfn/yaml",
"@aws-cdk/aws-codebuild/@aws-cdk/yaml-cfn/yaml/**",
"@aws-cdk/aws-codepipeline-actions/case",
"@aws-cdk/aws-codepipeline-actions/case/**",
"@aws-cdk/aws-cognito/punycode",
Expand All @@ -66,9 +63,6 @@
"@aws-cdk/cloud-assembly-schema/jsonschema/**",
"@aws-cdk/cloud-assembly-schema/semver",
"@aws-cdk/cloud-assembly-schema/semver/**",
"@aws-cdk/cloudformation-include/@aws-cdk/yaml-cfn",
"@aws-cdk/cloudformation-include/@aws-cdk/yaml-cfn/yaml",
"@aws-cdk/cloudformation-include/@aws-cdk/yaml-cfn/yaml/**",
"@aws-cdk/core/@balena/dockerignore",
"@aws-cdk/core/@balena/dockerignore/**",
"@aws-cdk/core/fs-extra",
Expand All @@ -81,9 +75,6 @@
"@aws-cdk/cx-api/semver/**",
"@aws-cdk/yaml-cfn/yaml",
"@aws-cdk/yaml-cfn/yaml/**",
"aws-cdk-lib/@aws-cdk/yaml-cfn",
"aws-cdk-lib/@aws-cdk/yaml-cfn/yaml",
"aws-cdk-lib/@aws-cdk/yaml-cfn/yaml/**",
"aws-cdk-lib/@balena/dockerignore",
"aws-cdk-lib/@balena/dockerignore/**",
"aws-cdk-lib/case",
Expand All @@ -102,9 +93,6 @@
"aws-cdk-lib/semver/**",
"aws-cdk-lib/yaml",
"aws-cdk-lib/yaml/**",
"monocdk/@aws-cdk/yaml-cfn",
"monocdk/@aws-cdk/yaml-cfn/yaml",
"monocdk/@aws-cdk/yaml-cfn/yaml/**",
"monocdk/@balena/dockerignore",
"monocdk/@balena/dockerignore/**",
"monocdk/case",
Expand Down
4 changes: 1 addition & 3 deletions packages/@aws-cdk/aws-codebuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@
"@aws-cdk/yaml-cfn": "0.0.0",
"constructs": "^3.3.69"
},
"bundledDependencies": [
"@aws-cdk/yaml-cfn"
],
"homepage": "https://github.com/aws/aws-cdk",
"peerDependencies": {
"@aws-cdk/aws-cloudwatch": "0.0.0",
Expand All @@ -122,6 +119,7 @@
"@aws-cdk/aws-secretsmanager": "0.0.0",
"@aws-cdk/core": "0.0.0",
"@aws-cdk/region-info": "0.0.0",
"@aws-cdk/yaml-cfn": "0.0.0",
"constructs": "^3.3.69"
},
"engines": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ export class ServerDeploymentGroup extends ServerDeploymentGroupBase {
'if [ -z "$PKG_CMD" ]; then',
'PKG_CMD=apt-get',
'else',
'PKG=CMD=yum',
'PKG_CMD=yum',
'fi',
'$PKG_CMD update -y',
'set +e', // make sure we don't exit on the next command failing (we check its exit code below)
Expand All @@ -367,8 +367,7 @@ export class ServerDeploymentGroup extends ServerDeploymentGroupBase {
'$PKG_CMD install -y ruby',
'fi',
'AWS_CLI_PACKAGE_NAME=awscli',
'if [[ "$PKG_CMD" = "yum" ]];',
'then',
'if [ "$PKG_CMD" = "yum" ]; then',
'AWS_CLI_PACKAGE_NAME=aws-cli',
'fi',
'$PKG_CMD install -y $AWS_CLI_PACKAGE_NAME',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@
"Fn::Join": [
"",
[
"#!/bin/bash\nset +e\nPKG_CMD=`which yum 2>/dev/null`\nset -e\nif [ -z \"$PKG_CMD\" ]; then\nPKG_CMD=apt-get\nelse\nPKG=CMD=yum\nfi\n$PKG_CMD update -y\nset +e\n$PKG_CMD install -y ruby2.0\nRUBY2_INSTALL=$?\nset -e\nif [ $RUBY2_INSTALL -ne 0 ]; then\n$PKG_CMD install -y ruby\nfi\nAWS_CLI_PACKAGE_NAME=awscli\nif [[ \"$PKG_CMD\" = \"yum\" ]];\nthen\nAWS_CLI_PACKAGE_NAME=aws-cli\nfi\n$PKG_CMD install -y $AWS_CLI_PACKAGE_NAME\nTMP_DIR=`mktemp -d`\ncd $TMP_DIR\naws s3 cp s3://aws-codedeploy-",
"#!/bin/bash\nset +e\nPKG_CMD=`which yum 2>/dev/null`\nset -e\nif [ -z \"$PKG_CMD\" ]; then\nPKG_CMD=apt-get\nelse\nPKG_CMD=yum\nfi\n$PKG_CMD update -y\nset +e\n$PKG_CMD install -y ruby2.0\nRUBY2_INSTALL=$?\nset -e\nif [ $RUBY2_INSTALL -ne 0 ]; then\n$PKG_CMD install -y ruby\nfi\nAWS_CLI_PACKAGE_NAME=awscli\nif [ \"$PKG_CMD\" = \"yum\" ]; then\nAWS_CLI_PACKAGE_NAME=aws-cli\nfi\n$PKG_CMD install -y $AWS_CLI_PACKAGE_NAME\nTMP_DIR=`mktemp -d`\ncd $TMP_DIR\naws s3 cp s3://aws-codedeploy-",
{
"Ref": "AWS::Region"
},
Expand Down Expand Up @@ -884,4 +884,4 @@
"Default": "/aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-gp2"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export = {
'Fn::Join': [
'',
[
'#!/bin/bash\nset +e\nPKG_CMD=`which yum 2>/dev/null`\nset -e\nif [ -z "$PKG_CMD" ]; then\nPKG_CMD=apt-get\nelse\nPKG=CMD=yum\nfi\n$PKG_CMD update -y\nset +e\n$PKG_CMD install -y ruby2.0\nRUBY2_INSTALL=$?\nset -e\nif [ $RUBY2_INSTALL -ne 0 ]; then\n$PKG_CMD install -y ruby\nfi\nAWS_CLI_PACKAGE_NAME=awscli\nif [[ "$PKG_CMD" = "yum" ]];\nthen\nAWS_CLI_PACKAGE_NAME=aws-cli\nfi\n$PKG_CMD install -y $AWS_CLI_PACKAGE_NAME\nTMP_DIR=`mktemp -d`\ncd $TMP_DIR\naws s3 cp s3://aws-codedeploy-',
'#!/bin/bash\nset +e\nPKG_CMD=`which yum 2>/dev/null`\nset -e\nif [ -z "$PKG_CMD" ]; then\nPKG_CMD=apt-get\nelse\nPKG_CMD=yum\nfi\n$PKG_CMD update -y\nset +e\n$PKG_CMD install -y ruby2.0\nRUBY2_INSTALL=$?\nset -e\nif [ $RUBY2_INSTALL -ne 0 ]; then\n$PKG_CMD install -y ruby\nfi\nAWS_CLI_PACKAGE_NAME=awscli\nif [ "$PKG_CMD" = "yum" ]; then\nAWS_CLI_PACKAGE_NAME=aws-cli\nfi\n$PKG_CMD install -y $AWS_CLI_PACKAGE_NAME\nTMP_DIR=`mktemp -d`\ncd $TMP_DIR\naws s3 cp s3://aws-codedeploy-',
{
'Ref': 'AWS::Region',
},
Expand Down
2 changes: 0 additions & 2 deletions packages/@aws-cdk/aws-lambda/lib/log-retention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { Construct } from 'constructs';

/**
* Retry options for all AWS API calls.
*
* @deprecated use `LogRetentionRetryOptions` from '@aws-cdk/aws-logs' instead
*/
export interface LogRetentionRetryOptions extends logs.LogRetentionRetryOptions {
}
Expand Down
9 changes: 8 additions & 1 deletion packages/@aws-cdk/aws-lambda/lib/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,23 @@ export class Runtime {
public readonly family?: RuntimeFamily;

/**
* The bundling Docker image for this runtime.
* DEPRECATED
* @deprecated use `bundlingImage`
*/
public readonly bundlingDockerImage: BundlingDockerImage;

/**
* The bundling Docker image for this runtime.
*/
public readonly bundlingImage: DockerImage;

constructor(name: string, family?: RuntimeFamily, props: LambdaRuntimeProps = { }) {
this.name = name;
this.supportsInlineCode = !!props.supportsInlineCode;
this.family = family;
const imageName = props.bundlingDockerImage ?? `amazon/aws-sam-cli-build-image-${name}`;
this.bundlingDockerImage = DockerImage.fromRegistry(imageName);
this.bundlingImage = this.bundlingDockerImage;
this.supportsCodeGuruProfiling = props.supportsCodeGuruProfiling ?? false;

Runtime.ALL.push(this);
Expand Down
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-rds/lib/cluster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,9 @@ interface InstanceConfig {
*/
function createInstances(cluster: DatabaseClusterNew, props: DatabaseClusterBaseProps, subnetGroup: ISubnetGroup): InstanceConfig {
const instanceCount = props.instances != null ? props.instances : 2;
if (Token.isUnresolved(instanceCount)) {
throw new Error('The number of instances an RDS Cluster consists of cannot be provided as a deploy-time only value!');
}
if (instanceCount < 1) {
throw new Error('At least one instance is required');
}
Expand Down
50 changes: 14 additions & 36 deletions packages/@aws-cdk/aws-rds/test/cluster.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,22 @@ describe('cluster', () => {
DeletionPolicy: 'Delete',
UpdateReplacePolicy: 'Delete',
}, ResourcePart.CompleteDefinition);
});

test('validates that the number of instances is not a deploy-time value', () => {
const stack = testStack();
const vpc = new ec2.Vpc(stack, 'VPC');
const parameter = new cdk.CfnParameter(stack, 'Param', { type: 'Number' });

expect(() => {
new DatabaseCluster(stack, 'Database', {
instances: parameter.valueAsNumber,
engine: DatabaseClusterEngine.AURORA,
instanceProps: {
vpc,
},
});
}).toThrow('The number of instances an RDS Cluster consists of cannot be provided as a deploy-time only value!');
});

test('can create a cluster with a single instance', () => {
Expand Down Expand Up @@ -81,8 +95,6 @@ describe('cluster', () => {
MasterUserPassword: 'tooshort',
VpcSecurityGroupIds: [{ 'Fn::GetAtt': ['DatabaseSecurityGroup5C91FDCB', 'GroupId'] }],
});


});

test('can create a cluster with imported vpc and security group', () => {
Expand Down Expand Up @@ -116,8 +128,6 @@ describe('cluster', () => {
MasterUserPassword: 'tooshort',
VpcSecurityGroupIds: ['SecurityGroupId12345'],
});


});

test('cluster with parameter group', () => {
Expand Down Expand Up @@ -150,8 +160,6 @@ describe('cluster', () => {
expect(stack).toHaveResource('AWS::RDS::DBCluster', {
DBClusterParameterGroupName: { Ref: 'ParamsA8366201' },
});


});

test("sets the retention policy of the SubnetGroup to 'Retain' if the Cluster is created with 'Retain'", () => {
Expand All @@ -172,8 +180,6 @@ describe('cluster', () => {
DeletionPolicy: 'Retain',
UpdateReplacePolicy: 'Retain',
}, ResourcePart.CompleteDefinition);


});

test('creates a secret when master credentials are not specified', () => {
Expand Down Expand Up @@ -230,8 +236,6 @@ describe('cluster', () => {
SecretStringTemplate: '{"username":"admin"}',
},
});


});

test('create an encrypted cluster with custom KMS key', () => {
Expand Down Expand Up @@ -261,8 +265,6 @@ describe('cluster', () => {
],
},
});


});

test('cluster with instance parameter group', () => {
Expand Down Expand Up @@ -294,8 +296,6 @@ describe('cluster', () => {
Ref: 'ParameterGroup5E32DECB',
},
});


});

describe('performance insights', () => {
Expand Down Expand Up @@ -323,8 +323,6 @@ describe('cluster', () => {
PerformanceInsightsRetentionPeriod: 731,
PerformanceInsightsKMSKeyId: { 'Fn::GetAtt': ['Key961B73FD', 'Arn'] },
});


});

test('setting performance insights fields enables performance insights', () => {
Expand All @@ -348,8 +346,6 @@ describe('cluster', () => {
EnablePerformanceInsights: true,
PerformanceInsightsRetentionPeriod: 731,
});


});

test('throws if performance insights fields are set but performance insights is disabled', () => {
Expand All @@ -370,8 +366,6 @@ describe('cluster', () => {
},
});
}).toThrow(/`enablePerformanceInsights` disabled, but `performanceInsightRetention` or `performanceInsightEncryptionKey` was set/);


});
});

Expand All @@ -392,8 +386,6 @@ describe('cluster', () => {
expect(stack).toHaveResource('AWS::RDS::DBInstance', {
AutoMinorVersionUpgrade: false,
});


});

test('cluster with allow upgrade of major version', () => {
Expand All @@ -413,8 +405,6 @@ describe('cluster', () => {
expect(stack).toHaveResourceLike('AWS::RDS::DBInstance', {
AllowMajorVersionUpgrade: true,
});


});

test('cluster with disallow remove backups', () => {
Expand All @@ -434,8 +424,6 @@ describe('cluster', () => {
expect(stack).toHaveResourceLike('AWS::RDS::DBInstance', {
DeleteAutomatedBackups: false,
});


});

test('create a cluster using a specific version of MySQL', () => {
Expand All @@ -462,8 +450,6 @@ describe('cluster', () => {
Engine: 'aurora-mysql',
EngineVersion: '5.7.mysql_aurora.2.04.4',
});


});

test('create a cluster using a specific version of Postgresql', () => {
Expand Down Expand Up @@ -513,8 +499,6 @@ describe('cluster', () => {

// THEN
expect(stack.resolve(cluster.clusterEndpoint)).not.toEqual(stack.resolve(cluster.clusterReadEndpoint));


});

test('imported cluster with imported security group honors allowAllOutbound', () => {
Expand All @@ -540,8 +524,6 @@ describe('cluster', () => {
expect(stack).toHaveResource('AWS::EC2::SecurityGroupEgress', {
GroupId: 'sg-123456789',
});


});

test('can import a cluster with minimal attributes', () => {
Expand All @@ -567,8 +549,6 @@ describe('cluster', () => {
expect(() => cluster.clusterReadEndpoint).toThrow(/Cannot access `clusterReadEndpoint` of an imported cluster/);
expect(() => cluster.instanceIdentifiers).toThrow(/Cannot access `instanceIdentifiers` of an imported cluster/);
expect(() => cluster.instanceEndpoints).toThrow(/Cannot access `instanceEndpoints` of an imported cluster/);


});

test('imported cluster can access properties if attributes are provided', () => {
Expand All @@ -590,8 +570,6 @@ describe('cluster', () => {
expect(cluster.clusterReadEndpoint.socketAddress).toEqual('reader-address:3306');
expect(cluster.instanceIdentifiers).toEqual(['identifier']);
expect(cluster.instanceEndpoints.map(endpoint => endpoint.socketAddress)).toEqual(['instance-addr:3306']);


});

test('cluster supports metrics', () => {
Expand Down
4 changes: 1 addition & 3 deletions packages/@aws-cdk/cloudformation-include/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@
"@aws-cdk/aws-wafv2": "0.0.0",
"@aws-cdk/aws-workspaces": "0.0.0",
"@aws-cdk/core": "0.0.0",
"@aws-cdk/yaml-cfn": "0.0.0",
"constructs": "^3.3.69"
},
"devDependencies": {
Expand All @@ -374,9 +375,6 @@
"pkglint": "0.0.0",
"ts-jest": "^26.5.4"
},
"bundledDependencies": [
"@aws-cdk/yaml-cfn"
],
"keywords": [
"aws",
"cdk",
Expand Down
Loading

0 comments on commit 10969e2

Please sign in to comment.