Skip to content

Commit

Permalink
Merge branch 'master' into corymhall/fix-cloudtrail-integ
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Apr 1, 2022
2 parents 57209da + 9c1c09e commit a8870eb
Show file tree
Hide file tree
Showing 122 changed files with 1,536 additions and 5,519 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/issue-label-assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ on:
issues:
types: [opened, edited]
pull_request:
types: [opened, edited]
types: [opened]
pull_request_target:
types: [opened, edited]
types: [opened]

jobs:
issue-triage-manager:
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
included-labels: "[guidance]"
default-area: ${{ env.OSDS_DEVS }}
parameters: >
[{"area":"guidance","keywords":["guidance"]}]
[{"area":"guidance","keywords":["guidancekeyword"]}]
pr-triage-manager:
permissions:
issues: write
Expand All @@ -51,9 +51,11 @@ jobs:
github-token: "${{ secrets.GITHUB_TOKEN }}"
target: "pull-requests"
area-is-keyword: true
excluded-labels: "[contribution/core]"
parameters: ${{ env.AREA_PARAMS }}
affixes: ${{ env.AREA_AFFIXES }}
default-area: >
{"reviewers":{"teamReviewers":["aws-cdk-owners"]}}
parameters: >
[{"area":"pullrequests","keywords":["pullrequestkeyword"]}]
env:
OSDS_DEVS: >
Expand Down
14 changes: 9 additions & 5 deletions allowed-breaking-changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,20 @@ strengthened:@aws-cdk/aws-stepfunctions-tasks.BatchSubmitJobProps
removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.cluster
strengthened:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps

# Remove IO2 from autoscaling EbsDeviceVolumeType. This value is not supported
# Remove IO2 from autoscaling EbsDeviceVolumeType. This value is not supported
# at the moment and was not supported in the past.
removed:@aws-cdk/aws-autoscaling.EbsDeviceVolumeType.IO2

# Remove autoTerminationPolicy from stepfunctions-tasks EmrCreateClusterProps. This value is not supported by stepfunctions at the moment and was not supported in the past.
removed:@aws-cdk/aws-stepfunctions-tasks.EmrCreateCluster.AutoTerminationPolicyProperty
removed:@aws-cdk/aws-stepfunctions-tasks.EmrCreateClusterProps.autoTerminationPolicy

# Changed property securityGroupId to optional because either securityGroupId or
# Changed property securityGroupId to optional because either securityGroupId or
# securityGroupName is required. Therefore securityGroupId is no longer mandatory.
weakened:@aws-cdk/cloud-assembly-schema.SecurityGroupContextQuery

# refactor autoscaling lifecycle hook target bind() methods to make role optional by
# having bind() methods create the role if it isn't passed to them
# having bind() methods create the role if it isn't passed to them
incompatible-argument:@aws-cdk/aws-autoscaling-hooktargets.FunctionHook.bind
incompatible-argument:@aws-cdk/aws-autoscaling-hooktargets.QueueHook.bind
incompatible-argument:@aws-cdk/aws-autoscaling-hooktargets.TopicHook.bind
Expand All @@ -106,7 +106,7 @@ removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.maxRecord
removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.parallelizationFactor
removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.reportBatchItemFailures
removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.retryAttempts
removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.tumblingWindow
removed:@aws-cdk/aws-lambda-event-sources.ManagedKafkaEventSourceProps.tumblingWindow
removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.bisectBatchOnError
removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.maxRecordAge
removed:@aws-cdk/aws-lambda-event-sources.SelfManagedKafkaEventSourceProps.parallelizationFactor
Expand All @@ -125,4 +125,8 @@ changed-type:@aws-cdk/aws-elasticloadbalancingv2.NetworkLoadBalancer.vpc
# removed methods and properties related to event bridge notifications for S3 buckets as they are not yet supported (19 Jan 2022)
removed:@aws-cdk/aws-s3.Bucket.enableEventBridgeNotification
removed:@aws-cdk/aws-s3.BucketBase.enableEventBridgeNotification
removed:@aws-cdk/aws-s3.BucketProps.eventBridgeEnabled
removed:@aws-cdk/aws-s3.BucketProps.eventBridgeEnabled

# changed the type of RDS's SnapshotCredentials.secret from Secret to ISecret,
# shouldn't matter
changed-type:@aws-cdk/aws-rds.SnapshotCredentials.secret
9 changes: 6 additions & 3 deletions packages/@aws-cdk/aws-apigateway/lib/restapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,11 @@ export abstract class RestApiBase extends Resource implements IRestApi {
protected cloudWatchAccount?: CfnAccount;

constructor(scope: Construct, id: string, props: RestApiBaseProps = { }) {
super(scope, id);
this.restApiName = props.restApiName ?? id;
const restApiName = props.restApiName ?? id;
super(scope, id, {
physicalName: restApiName,
});
this.restApiName = restApiName;

Object.defineProperty(this, RESTAPI_SYMBOL, { value: true });
}
Expand Down Expand Up @@ -736,7 +739,7 @@ export class RestApi extends RestApiBase {
super(scope, id, props);

const resource = new CfnRestApi(this, 'Resource', {
name: this.restApiName,
name: this.physicalName,
description: props.description,
policy: props.policy,
failOnWarnings: props.failOnWarnings,
Expand Down
20 changes: 20 additions & 0 deletions packages/@aws-cdk/aws-apigateway/test/lambda-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,24 @@ describe('lambda api', () => {
],
});
});

test('LambdaRestApi allows passing GENERATE_IF_NEEDED as the physical name', () => {
// GIVEN
const stack = new cdk.Stack();

// WHEN
new apigw.LambdaRestApi(stack, 'lambda-rest-api', {
handler: new lambda.Function(stack, 'handler', {
handler: 'index.handler',
code: lambda.Code.fromInline('boom'),
runtime: lambda.Runtime.NODEJS_10_X,
}),
restApiName: cdk.PhysicalName.GENERATE_IF_NEEDED,
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::ApiGateway::RestApi', {
Name: Match.absent(),
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,13 @@
]
},
"Handler": "index.handler",
"Runtime": "nodejs10.x"
"Runtime": "nodejs14.x"
},
"DependsOn": [
"HandlerServiceRoleFCDC14AE"
]
},
"HandlerCurrentVersion93FB80BFb2de9794fd0f0df5e5c01c16ba4b05cf": {
"HandlerCurrentVersion93FB80BFb2a9ce598bf2730613c07e406cddb6b6": {
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand All @@ -101,7 +101,7 @@
},
"FunctionVersion": {
"Fn::GetAtt": [
"HandlerCurrentVersion93FB80BFb2de9794fd0f0df5e5c01c16ba4b05cf",
"HandlerCurrentVersion93FB80BFb2a9ce598bf2730613c07e406cddb6b6",
"Version"
]
},
Expand Down Expand Up @@ -250,7 +250,7 @@
]
},
"Handler": "index.handler",
"Runtime": "nodejs10.x"
"Runtime": "nodejs14.x"
},
"DependsOn": [
"PreHookServiceRoleDefaultPolicy65358F76",
Expand Down Expand Up @@ -383,7 +383,7 @@
]
},
"Handler": "index.handler",
"Runtime": "nodejs10.x"
"Runtime": "nodejs14.x"
},
"DependsOn": [
"PostHookServiceRoleDefaultPolicy82AEE758",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const stack = new cdk.Stack(app, 'aws-cdk-codedeploy-lambda');
const handler = new lambda.Function(stack, 'Handler', {
code: lambda.Code.fromAsset(path.join(__dirname, 'handler')),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});
const version = handler.currentVersion;
const blueGreenAlias = new lambda.Alias(stack, 'Alias', {
Expand All @@ -22,12 +22,12 @@ const blueGreenAlias = new lambda.Alias(stack, 'Alias', {
const preHook = new lambda.Function(stack, 'PreHook', {
code: lambda.Code.fromAsset(path.join(__dirname, 'preHook')),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});
const postHook = new lambda.Function(stack, 'PostHook', {
code: lambda.Code.fromAsset(path.join(__dirname, 'postHook')),
handler: 'index.handler',
runtime: lambda.Runtime.NODEJS_10_X,
runtime: lambda.Runtime.NODEJS_14_X,
});

new codedeploy.LambdaDeploymentGroup(stack, 'BlueGreenDeployment', {
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cognito/lib/user-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ export class UserPool extends UserPoolBase {
const capitalize = name.charAt(0).toUpperCase() + name.slice(1);
fn.addPermission(`${capitalize}Cognito`, {
principal: new ServicePrincipal('cognito-idp.amazonaws.com'),
sourceArn: this.userPoolArn,
sourceArn: Lazy.string({ produce: () => this.userPoolArn }),
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@
"Arn"
]
},
"Principal": "cognito-idp.amazonaws.com"
"Principal": "cognito-idp.amazonaws.com",
"SourceArn": {
"Fn::GetAtt": [
"pool056F3F7E",
"Arn"
]
}
}
},
"keyFEDD6EC0": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@
"Arn"
]
},
"Principal": "cognito-idp.amazonaws.com"
"Principal": "cognito-idp.amazonaws.com",
"SourceArn": {
"Fn::GetAtt": [
"myuserpool01998219",
"Arn"
]
}
}
},
"customMessageServiceRoleB4AE7F17": {
Expand Down Expand Up @@ -125,7 +131,13 @@
"Arn"
]
},
"Principal": "cognito-idp.amazonaws.com"
"Principal": "cognito-idp.amazonaws.com",
"SourceArn": {
"Fn::GetAtt": [
"myuserpool01998219",
"Arn"
]
}
}
},
"defineAuthChallengeServiceRole9E2D15DF": {
Expand Down Expand Up @@ -189,7 +201,13 @@
"Arn"
]
},
"Principal": "cognito-idp.amazonaws.com"
"Principal": "cognito-idp.amazonaws.com",
"SourceArn": {
"Fn::GetAtt": [
"myuserpool01998219",
"Arn"
]
}
}
},
"postAuthenticationServiceRole5B3B242A": {
Expand Down Expand Up @@ -253,7 +271,13 @@
"Arn"
]
},
"Principal": "cognito-idp.amazonaws.com"
"Principal": "cognito-idp.amazonaws.com",
"SourceArn": {
"Fn::GetAtt": [
"myuserpool01998219",
"Arn"
]
}
}
},
"postConfirmationServiceRole864BE5F9": {
Expand Down Expand Up @@ -317,7 +341,13 @@
"Arn"
]
},
"Principal": "cognito-idp.amazonaws.com"
"Principal": "cognito-idp.amazonaws.com",
"SourceArn": {
"Fn::GetAtt": [
"myuserpool01998219",
"Arn"
]
}
}
},
"preAuthenticationServiceRole9712F4D8": {
Expand Down Expand Up @@ -381,7 +411,13 @@
"Arn"
]
},
"Principal": "cognito-idp.amazonaws.com"
"Principal": "cognito-idp.amazonaws.com",
"SourceArn": {
"Fn::GetAtt": [
"myuserpool01998219",
"Arn"
]
}
}
},
"preSignUpServiceRole0A7E91EB": {
Expand Down Expand Up @@ -445,7 +481,13 @@
"Arn"
]
},
"Principal": "cognito-idp.amazonaws.com"
"Principal": "cognito-idp.amazonaws.com",
"SourceArn": {
"Fn::GetAtt": [
"myuserpool01998219",
"Arn"
]
}
}
},
"preTokenGenerationServiceRole430C3D14": {
Expand Down Expand Up @@ -509,7 +551,13 @@
"Arn"
]
},
"Principal": "cognito-idp.amazonaws.com"
"Principal": "cognito-idp.amazonaws.com",
"SourceArn": {
"Fn::GetAtt": [
"myuserpool01998219",
"Arn"
]
}
}
},
"userMigrationServiceRole091766B0": {
Expand Down Expand Up @@ -573,7 +621,13 @@
"Arn"
]
},
"Principal": "cognito-idp.amazonaws.com"
"Principal": "cognito-idp.amazonaws.com",
"SourceArn": {
"Fn::GetAtt": [
"myuserpool01998219",
"Arn"
]
}
}
},
"verifyAuthChallengeResponseServiceRole7077884C": {
Expand Down Expand Up @@ -637,7 +691,13 @@
"Arn"
]
},
"Principal": "cognito-idp.amazonaws.com"
"Principal": "cognito-idp.amazonaws.com",
"SourceArn": {
"Fn::GetAtt": [
"myuserpool01998219",
"Arn"
]
}
}
},
"myuserpoolsmsRole0E16FDD9": {
Expand Down
Loading

0 comments on commit a8870eb

Please sign in to comment.