Skip to content

Commit

Permalink
chore(release): 1.170.0 (#21765)
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Aug 25, 2022
2 parents c06c826 + 8f2efa1 commit 4303dca
Show file tree
Hide file tree
Showing 229 changed files with 1,587 additions and 1,267 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ jobs:
permissions:
pull-requests: write
steps:
- uses: hmarr/auto-approve-action@v2.2.1
- uses: hmarr/auto-approve-action@v2.4.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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.170.0](https://github.com/aws/aws-cdk/compare/v1.169.0...v1.170.0) (2022-08-25)


### Features

* **cfnspec:** cloudformation spec v85.0.0 ([#21680](https://github.com/aws/aws-cdk/issues/21680)) ([c6776f2](https://github.com/aws/aws-cdk/commit/c6776f23c6ab70e0ed354d72ec4892e99a7e2d18))


### Bug Fixes

* **ecs:** firelens configFileValue is unnecessarily required (backport [#20636](https://github.com/aws/aws-cdk/issues/20636)) ([#21710](https://github.com/aws/aws-cdk/issues/21710)) ([e2c48da](https://github.com/aws/aws-cdk/commit/e2c48dacbf5f8c09c7c143b043ba2622987e42d9))

## [1.169.0](https://github.com/aws/aws-cdk/compare/v1.168.0...v1.169.0) (2022-08-17)


Expand Down
3 changes: 3 additions & 0 deletions allowed-breaking-changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,6 @@ removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.onFai

# removed kubernetes version from EKS
removed:@aws-cdk/aws-eks.KubernetesVersion.V1_22

#configFileValue is unnecessarily required; not a breaking change
weakened:@aws-cdk/aws-ecs.FirelensOptions
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
"devDependencies": {
"@types/prettier": "2.6.0",
"@yarnpkg/lockfile": "^1.1.0",
"cdk-generate-synthetic-examples": "^0.1.14",
"cdk-generate-synthetic-examples": "^0.1.16",
"conventional-changelog-cli": "^2.2.2",
"fs-extra": "^9.1.0",
"graceful-fs": "^4.2.10",
"jest-junit": "^13.2.0",
"jsii-diff": "^1.63.2",
"jsii-pacmak": "^1.63.2",
"jsii-reflect": "^1.63.2",
"jsii-rosetta": "^1.63.2",
"jsii-diff": "^1.65.0",
"jsii-pacmak": "^1.65.0",
"jsii-reflect": "^1.65.0",
"jsii-rosetta": "^1.65.0",
"lerna": "^4.0.0",
"patch-package": "^6.4.7",
"semver": "^6.3.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codepipeline-actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@aws-cdk/cx-api": "0.0.0",
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"@types/lodash": "^4.14.182",
"@types/lodash": "^4.14.184",
"jest": "^27.5.1",
"lodash": "^4.17.21"
},
Expand Down
65 changes: 46 additions & 19 deletions packages/@aws-cdk/aws-ecs/lib/firelens-log-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,22 @@ export interface FirelensOptions {
readonly enableECSLogMetadata?: boolean;

/**
* Custom configuration file, s3 or file
* Custom configuration file, s3 or file.
* Both configFileType and configFileValue must be used together
* to define a custom configuration source.
*
* @default - determined by checking configFileValue with S3 ARN.
*/
readonly configFileType?: FirelensConfigFileType;

/**
* Custom configuration file, S3 ARN or a file path
* Both configFileType and configFileValue must be used together
* to define a custom configuration source.
*
* @default - no config file value
*/
readonly configFileValue: string;
readonly configFileValue?: string;
}

/**
Expand Down Expand Up @@ -109,6 +116,16 @@ export interface FirelensLogRouterDefinitionOptions extends ContainerDefinitionO
function renderFirelensConfig(firelensConfig: FirelensConfig): CfnTaskDefinition.FirelensConfigurationProperty {
if (!firelensConfig.options) {
return { type: firelensConfig.type };
} else if (firelensConfig.options.configFileValue === undefined) {
// config file options work as a pair together to define a custom config source
// a custom config source is optional,
// and thus the `config-file-x` keys should be set together or not at all
return {
type: firelensConfig.type,
options: {
'enable-ecs-log-metadata': firelensConfig.options.enableECSLogMetadata ? 'true' : 'false',
},
};
} else {
// firelensConfig.options.configFileType has been filled with s3 or file type in constructor.
return {
Expand Down Expand Up @@ -201,33 +218,43 @@ export class FirelensLogRouter extends ContainerDefinition {
super(scope, id, props);
const options = props.firelensConfig.options;
if (options) {
if ((options.configFileValue && options.configFileType === undefined) || (options.configFileValue === undefined && options.configFileType)) {
throw new Error('configFileValue and configFileType must be set together to define a custom config source');
}

const hasConfig = (options.configFileValue !== undefined);
const enableECSLogMetadata = options.enableECSLogMetadata || options.enableECSLogMetadata === undefined;
const configFileType = (options.configFileType === undefined || options.configFileType === FirelensConfigFileType.S3) &&
(cdk.Token.isUnresolved(options.configFileValue) || /arn:aws[a-zA-Z-]*:s3:::.+/.test(options.configFileValue))
(cdk.Token.isUnresolved(options.configFileValue) || /arn:aws[a-zA-Z-]*:s3:::.+/.test(options.configFileValue || ''))
? FirelensConfigFileType.S3 : FirelensConfigFileType.FILE;

this.firelensConfig = {
type: props.firelensConfig.type,
options: {
enableECSLogMetadata,
configFileType,
configFileValue: options.configFileValue,
...(hasConfig ? {
configFileType,
configFileValue: options.configFileValue,
} : {}),
},
};

// grant s3 access permissions
if (configFileType === FirelensConfigFileType.S3) {
props.taskDefinition.addToExecutionRolePolicy(new iam.PolicyStatement({
actions: [
's3:GetObject',
],
resources: [options.configFileValue],
}));
props.taskDefinition.addToExecutionRolePolicy(new iam.PolicyStatement({
actions: [
's3:GetBucketLocation',
],
resources: [options.configFileValue.split('/')[0]],
}));
if (hasConfig) {
// grant s3 access permissions
if (configFileType === FirelensConfigFileType.S3) {
props.taskDefinition.addToExecutionRolePolicy(new iam.PolicyStatement({
actions: [
's3:GetObject',
],
resources: [(options.configFileValue ?? '')],
}));
props.taskDefinition.addToExecutionRolePolicy(new iam.PolicyStatement({
actions: [
's3:GetBucketLocation',
],
resources: [(options.configFileValue ?? '').split('/')[0]],
}));
}
}
} else {
this.firelensConfig = props.firelensConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ taskDefinition.addFirelensLogRouter('log_router', {
options: {
enableECSLogMetadata: false,
configFileValue: `${asset.bucket.bucketArn}/${asset.s3ObjectKey}`,
configFileType: ecs.FirelensConfigFileType.S3,
},
},
logging: new ecs.AwsLogDriver({ streamPrefix: 'firelens' }),
Expand Down
33 changes: 33 additions & 0 deletions packages/@aws-cdk/aws-ecs/test/firelens-log-driver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ describe('firelens log driver', () => {
options: {
enableECSLogMetadata: false,
configFileValue: 'arn:aws:s3:::mybucket/fluent.conf',
configFileType: ecs.FirelensConfigFileType.S3,
},
},
logging: new ecs.AwsLogDriver({ streamPrefix: 'firelens' }),
Expand Down Expand Up @@ -349,5 +350,37 @@ describe('firelens log driver', () => {
],
});
});

test('firelens config options are fully optional', () => {
// GIVEN
td.addFirelensLogRouter('log_router', {
image: ecs.obtainDefaultFluentBitECRImage(td, undefined, '2.1.0'),
firelensConfig: {
type: ecs.FirelensLogRouterType.FLUENTBIT,
options: {
enableECSLogMetadata: false,
},
},
logging: new ecs.AwsLogDriver({ streamPrefix: 'firelens' }),
memoryReservationMiB: 50,
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::ECS::TaskDefinition', {
ContainerDefinitions: [
Match.objectLike({
Essential: true,
MemoryReservation: 50,
Name: 'log_router',
FirelensConfiguration: {
Type: 'fluentbit',
Options: {
'enable-ecs-log-metadata': 'false',
},
},
}),
],
});
});
});
});
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-eks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"@types/sinon": "^9.0.11",
"@types/yaml": "1.9.6",
"aws-sdk": "^2.848.0",
"cdk8s": "^1.6.80",
"cdk8s": "^1.7.9",
"cdk8s-plus-21": "^1.0.0-beta.186",
"jest": "^27.5.1",
"sinon": "^9.2.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"@aws-cdk/pkglint": "0.0.0",
"@types/jest": "^27.5.2",
"delay": "5.0.0",
"esbuild": "^0.15.0"
"esbuild": "^0.15.5"
},
"dependencies": {
"@aws-cdk/aws-lambda": "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"@aws-cdk/pkglint": "0.0.0",
"@types/aws-lambda": "^8.10.102",
"@types/jest": "^27.5.2",
"@types/lodash": "^4.14.182",
"@types/lodash": "^4.14.184",
"jest": "^27.5.1",
"lodash": "^4.17.21"
},
Expand Down
91 changes: 91 additions & 0 deletions packages/@aws-cdk/cfnspec/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,94 @@
# CloudFormation Resource Specification v85.0.0

## New Resource Types


## Attribute Changes

* AWS::RDS::DBParameterGroup Documentation (__changed__)
* Old: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbparametergroup.html
* New: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbparametergroup.html
* AWS::RDS::DBParameterGroup DBParameterGroupName (__deleted__)

## Property Changes

* AWS::Connect::ContactFlow Type.Required (__changed__)
* Old: false
* New: true
* AWS::EC2::LaunchTemplate VersionDescription (__added__)
* AWS::Lambda::EventSourceMapping AmazonManagedKafkaEventSourceConfig (__added__)
* AWS::Lambda::EventSourceMapping SelfManagedKafkaEventSourceConfig (__added__)
* AWS::OpenSearchService::Domain AdvancedSecurityOptions.UpdateType (__changed__)
* Old: Immutable
* New: Mutable
* AWS::RDS::DBInstance AvailabilityZone.UpdateType (__changed__)
* Old: Immutable
* New: Mutable
* AWS::RDS::DBParameterGroup Description.Documentation (__changed__)
* Old: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbparametergroup.html#cfn-rds-dbparametergroup-description
* New: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbparametergroup.html#cfn-rds-dbparametergroup-description
* AWS::RDS::DBParameterGroup Description.UpdateType (__changed__)
* Old: Immutable
* New: Mutable
* AWS::RDS::DBParameterGroup Family.Documentation (__changed__)
* Old: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbparametergroup.html#cfn-rds-dbparametergroup-family
* New: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbparametergroup.html#cfn-rds-dbparametergroup-family
* AWS::RDS::DBParameterGroup Family.UpdateType (__changed__)
* Old: Immutable
* New: Mutable
* AWS::RDS::DBParameterGroup Parameters.PrimitiveType (__deleted__)
* AWS::RDS::DBParameterGroup Parameters.DuplicatesAllowed (__added__)
* AWS::RDS::DBParameterGroup Parameters.PrimitiveItemType (__added__)
* AWS::RDS::DBParameterGroup Parameters.Type (__added__)
* AWS::RDS::DBParameterGroup Parameters.Documentation (__changed__)
* Old: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbparametergroup.html#cfn-rds-dbparametergroup-parameters
* New: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbparametergroup.html#cfn-rds-dbparametergroup-parameters
* AWS::RDS::DBParameterGroup Tags.Documentation (__changed__)
* Old: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-rds-dbparametergroup.html#cfn-rds-dbparametergroup-tags
* New: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-rds-dbparametergroup.html#cfn-rds-dbparametergroup-tags
* AWS::Redshift::EndpointAccess ClusterIdentifier.Required (__changed__)
* Old: false
* New: true
* AWS::Redshift::EndpointAccess SubnetGroupName.Required (__changed__)
* Old: false
* New: true

## Property Type Changes

* AWS::EC2::NetworkInsightsAnalysis.AdditionalDetail (__added__)
* AWS::Lambda::EventSourceMapping.AmazonManagedKafkaEventSourceConfig (__added__)
* AWS::Lambda::EventSourceMapping.SelfManagedKafkaEventSourceConfig (__added__)
* AWS::EC2::NetworkInsightsAnalysis.AnalysisRouteTableRoute State (__added__)
* AWS::EC2::NetworkInsightsAnalysis.Explanation ComponentAccount (__added__)
* AWS::EC2::NetworkInsightsAnalysis.Explanation ComponentRegion (__added__)
* AWS::EC2::NetworkInsightsAnalysis.PathComponent AdditionalDetails (__added__)
* AWS::EC2::NetworkInsightsAnalysis.PathComponent ElasticLoadBalancerListener (__added__)
* AWS::EC2::NetworkInsightsAnalysis.PathComponent Explanations (__added__)
* AWS::OpenSearchService::Domain.AdvancedSecurityOptionsInput Enabled.UpdateType (__changed__)
* Old: Immutable
* New: Mutable
* AWS::OpenSearchService::Domain.AdvancedSecurityOptionsInput InternalUserDatabaseEnabled.UpdateType (__changed__)
* Old: Immutable
* New: Mutable
* AWS::OpenSearchService::Domain.AdvancedSecurityOptionsInput MasterUserOptions.UpdateType (__changed__)
* Old: Immutable
* New: Mutable
* AWS::OpenSearchService::Domain.EBSOptions Throughput (__added__)
* AWS::OpenSearchService::Domain.MasterUserOptions MasterUserARN.UpdateType (__changed__)
* Old: Immutable
* New: Mutable
* AWS::OpenSearchService::Domain.MasterUserOptions MasterUserName.UpdateType (__changed__)
* Old: Immutable
* New: Mutable
* AWS::OpenSearchService::Domain.MasterUserOptions MasterUserPassword.UpdateType (__changed__)
* Old: Immutable
* New: Mutable

## Unapplied changes

* AWS::Rekognition is at 68.0.0
* AWS::SageMaker is at 72.0.0

# CloudFormation Resource Specification v84.0.0

## New Resource Types
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/cfnspec/cfn.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
84.0.0
85.0.0
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "84.0.0",
"$version": "85.0.0",
"PropertyTypes": {
"AWS::ACMPCA::Certificate.ApiPassthrough": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-acmpca-certificate-apipassthrough.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "84.0.0",
"$version": "85.0.0",
"PropertyTypes": {},
"ResourceTypes": {
"AWS::APS::RuleGroupsNamespace": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "84.0.0",
"$version": "85.0.0",
"PropertyTypes": {
"AWS::AccessAnalyzer::Analyzer.ArchiveRule": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-accessanalyzer-analyzer-archiverule.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "84.0.0",
"$version": "85.0.0",
"PropertyTypes": {
"AWS::AmazonMQ::Broker.ConfigurationId": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amazonmq-broker-configurationid.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "84.0.0",
"$version": "85.0.0",
"PropertyTypes": {
"AWS::Amplify::App.AutoBranchCreationConfig": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplify-app-autobranchcreationconfig.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "84.0.0",
"$version": "85.0.0",
"PropertyTypes": {
"AWS::AmplifyUIBuilder::Component.ActionParameters": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-amplifyuibuilder-component-actionparameters.html",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$version": "84.0.0",
"$version": "85.0.0",
"PropertyTypes": {
"AWS::ApiGateway::ApiKey.StageKey": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigateway-apikey-stagekey.html",
Expand Down
Loading

0 comments on commit 4303dca

Please sign in to comment.