Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: forward merge 'master' into 'v2-main' #20574

Merged
merged 29 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7a01099
chore(release): 1.158.0
May 27, 2022
953afa9
docs(cfnspec): update CloudFormation documentation (#20519)
aws-cdk-automation May 27, 2022
7779531
feat(integ-runner): publish integ-runner cli (#20477)
corymhall May 27, 2022
c274c2f
fix(integ-runner): don't throw error if tests pass (#20511)
corymhall May 27, 2022
df419ba
chore: empty commit to trigger pr build
madeline-k May 27, 2022
6f4aba8
Fix error message when creating a NodeJS function (#20524)
sblackstone May 27, 2022
ab28878
chore(release): 1.158.0 (#20517)
mergify[bot] May 27, 2022
b7bc10c
fix: Default username in RoleSessionName (#20188)
adambro May 27, 2022
dacefd6
fix(ecs): canContainersAccessInstanceRole is ignored when passed in A…
daschaa May 27, 2022
a4318e1
Merge branch 'master' into merge-back/1.158.0
mergify[bot] May 27, 2022
d1242a1
chore(merge-back): 1.158.0 (#20529)
mergify[bot] May 27, 2022
f4439ce
fix(ecs): fix typo from fromServiceAtrributes to fromServiceAttribute…
dafujii May 28, 2022
3a0077e
docs(cfnspec): update CloudFormation documentation (#20540)
aws-cdk-automation May 30, 2022
d814293
chore(deps): Bump awscli from 1.24.5 to 1.24.10 in /packages/@aws-cdk…
dependabot[bot] May 30, 2022
cedfde8
fix(integ-runner): catch snapshot errors, treat `--from-file` as comm…
rix0rrr May 31, 2022
33acc7c
feat(cognito): OpenID Connect identity provider (#20241)
jogold May 31, 2022
27fdaf1
chore(lambda-nodejs): fix typo (#20557)
ashokm May 31, 2022
2bf30df
feat(s3): adds objectSizeLessThan property for s3 lifecycle rule (#20…
daschaa May 31, 2022
68761dc
feat(lambda): add insights version 1.0.135.0 (#19588)
vvo May 31, 2022
f19ecef
fix(lambda): function version ignores layer version changes (#20150)
kaizencc May 31, 2022
e44c2c4
fix(core): logicalId is consumed prior to being overridden (#20560)
corymhall Jun 1, 2022
9a23575
fix(ecr-assets): cannot build ARM images using modern stack synthesis…
joeflateau Jun 1, 2022
264c02e
fix(iam): referencing the same immutable role twice makes it mutable …
corymhall Jun 1, 2022
74318c7
fix(events-targets): EventBus IAM statements are only added for the f…
comcalvi Jun 1, 2022
261d3df
Merge branch 'v2-main' into v2/forward-merge-20220601
madeline-k Jun 1, 2022
e9e8864
automatic pkglint fixes
madeline-k Jun 1, 2022
22678f8
core: fix unit test
madeline-k Jun 1, 2022
93d4d27
lambda: use constructs.IConstruct
madeline-k Jun 1, 2022
4b0f8ff
lambda: update unit tests for v2 branch
madeline-k Jun 1, 2022
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
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@

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.158.0](https://github.com/aws/aws-cdk/compare/v1.157.0...v1.158.0) (2022-05-27)


### Features

* **apprunner:** VpcConnector construct ([#20471](https://github.com/aws/aws-cdk/issues/20471)) ([5052191](https://github.com/aws/aws-cdk/commit/50521911f22f433323d700db77530e883762138a))
* **aws-ecr-assets:** support the --platform option when building docker images ([#20439](https://github.com/aws/aws-cdk/issues/20439)) ([adc0368](https://github.com/aws/aws-cdk/commit/adc0368dc1f137aeaa4bd92de77028269e3a48f4)), closes [#12472](https://github.com/aws/aws-cdk/issues/12472) [#16770](https://github.com/aws/aws-cdk/issues/16770) [#16858](https://github.com/aws/aws-cdk/issues/16858)
* **lambda:** validate function description length ([#20476](https://github.com/aws/aws-cdk/issues/20476)) ([de027e2](https://github.com/aws/aws-cdk/commit/de027e28ce5c95e70fed8874e6531eabba24521c)), closes [#20475](https://github.com/aws/aws-cdk/issues/20475)
* **s3:** adds objectSizeGreaterThan property for s3 lifecycle rule ([#20425](https://github.com/aws/aws-cdk/issues/20425)) ([23690e4](https://github.com/aws/aws-cdk/commit/23690e40b1604839f99da8b8f96168dda8679c47)), closes [#20372](https://github.com/aws/aws-cdk/issues/20372)
* **servicecatalog:** ProductStackHistory can retain old ProductStack iterations ([#20244](https://github.com/aws/aws-cdk/issues/20244)) ([1037b8c](https://github.com/aws/aws-cdk/commit/1037b8c7f58ccd162491b49d75954c38d685d67f))


### Bug Fixes

* **core:** NestedStack defaultChild is undefined ([#20450](https://github.com/aws/aws-cdk/issues/20450)) ([0a49927](https://github.com/aws/aws-cdk/commit/0a49927e9e5bc250f339f664fa843fae2fab92ec)), closes [#11221](https://github.com/aws/aws-cdk/issues/11221)
* **iam:** Role policies cannot grow beyond 10k ([#20400](https://github.com/aws/aws-cdk/issues/20400)) ([75bfce7](https://github.com/aws/aws-cdk/commit/75bfce70dbc57fe688c96b3c5cbb67fc4e6fcc56)), closes [#19276](https://github.com/aws/aws-cdk/issues/19276) [#19939](https://github.com/aws/aws-cdk/issues/19939) [#19835](https://github.com/aws/aws-cdk/issues/19835)
* **integ-runner:** always resynth on deploy ([#20508](https://github.com/aws/aws-cdk/issues/20508)) ([7138057](https://github.com/aws/aws-cdk/commit/71380571b878a50fe4b754c7dac78da075a98242))
* **integ-tests:** DeployAssert should be private ([#20466](https://github.com/aws/aws-cdk/issues/20466)) ([0f52813](https://github.com/aws/aws-cdk/commit/0f52813bcf6a48c352f697004a899461dd06935d))
* **lambda:** Fix typo in public subnet warning ([#20470](https://github.com/aws/aws-cdk/issues/20470)) ([85f4e29](https://github.com/aws/aws-cdk/commit/85f4e29e0551d71dd5f2f588584785cbc1ae7b72))
* **pipelines:** too many CodeBuild steps inflate policy size ([#20396](https://github.com/aws/aws-cdk/issues/20396)) ([f334060](https://github.com/aws/aws-cdk/commit/f334060fca02e928bc4f5fdcfd45244060731d78)), closes [#20189](https://github.com/aws/aws-cdk/issues/20189) [#19276](https://github.com/aws/aws-cdk/issues/19276) [#19939](https://github.com/aws/aws-cdk/issues/19939) [#19835](https://github.com/aws/aws-cdk/issues/19835)
* **s3-deployment:** default role does not get `PutAcl` permissions on… ([#20492](https://github.com/aws/aws-cdk/issues/20492)) ([3e6ec5c](https://github.com/aws/aws-cdk/commit/3e6ec5c48cff41cec2b32566990046fd704f4ec1))

## [1.157.0](https://github.com/aws/aws-cdk/compare/v1.156.1...v1.157.0) (2022-05-20)


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
Expand Up @@ -53,7 +53,7 @@
"LambdaServiceRoleA8ED4D3B"
]
},
"LambdaCurrentVersionDF706F6A9a632a294ae3a9cd4d550f1c4e26619d": {
"LambdaCurrentVersionDF706F6A1ee13d0fa54e9f5621e8c7b616fc53fc": {
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand All @@ -72,7 +72,7 @@
{
"EventType": "origin-request",
"LambdaFunctionARN": {
"Ref": "LambdaCurrentVersionDF706F6A9a632a294ae3a9cd4d550f1c4e26619d"
"Ref": "LambdaCurrentVersionDF706F6A1ee13d0fa54e9f5621e8c7b616fc53fc"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "18.0.0",
"version": "20.0.0",
"testCases": {
"aws-cloudfront/test/integ.distribution-lambda": {
"integ.distribution-lambda": {
"stacks": [
"integ-distribution-lambda"
],
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 @@ -30,14 +30,23 @@
"/integ-distribution-lambda/Lambda/CurrentVersion/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "LambdaCurrentVersionDF706F6A9a632a294ae3a9cd4d550f1c4e26619d"
"data": "LambdaCurrentVersionDF706F6A1ee13d0fa54e9f5621e8c7b616fc53fc"
}
],
"/integ-distribution-lambda/Dist/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "DistB3B78991"
}
],
"LambdaCurrentVersionDF706F6A9a632a294ae3a9cd4d550f1c4e26619d": [
{
"type": "aws:cdk:logicalId",
"data": "LambdaCurrentVersionDF706F6A9a632a294ae3a9cd4d550f1c4e26619d",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
]
}
]
},
"displayName": "integ-distribution-lambda"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"lambdaFunctionAssociations": [
{
"lambdaFunctionArn": {
"Ref": "LambdaCurrentVersionDF706F6A9a632a294ae3a9cd4d550f1c4e26619d"
"Ref": "LambdaCurrentVersionDF706F6A1ee13d0fa54e9f5621e8c7b616fc53fc"
},
"eventType": "origin-request"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"HandlerServiceRoleFCDC14AE"
]
},
"HandlerCurrentVersion93FB80BFb2a9ce598bf2730613c07e406cddb6b6": {
"HandlerCurrentVersion93FB80BFf2e6129c63154d1f37c0092df295ab51": {
"Type": "AWS::Lambda::Version",
"Properties": {
"FunctionName": {
Expand All @@ -101,7 +101,7 @@
},
"FunctionVersion": {
"Fn::GetAtt": [
"HandlerCurrentVersion93FB80BFb2a9ce598bf2730613c07e406cddb6b6",
"HandlerCurrentVersion93FB80BFf2e6129c63154d1f37c0092df295ab51",
"Version"
]
},
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,7 +1,7 @@
{
"version": "18.0.0",
"version": "20.0.0",
"testCases": {
"aws-codedeploy/test/lambda/integ.deployment-group": {
"lambda/integ.deployment-group": {
"stacks": [
"aws-cdk-codedeploy-lambda"
],
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 @@ -68,7 +68,7 @@
"/aws-cdk-codedeploy-lambda/Handler/CurrentVersion/Resource": [
{
"type": "aws:cdk:logicalId",
"data": "HandlerCurrentVersion93FB80BFb2a9ce598bf2730613c07e406cddb6b6"
"data": "HandlerCurrentVersion93FB80BFf2e6129c63154d1f37c0092df295ab51"
}
],
"/aws-cdk-codedeploy-lambda/AssetParameters/edb7466707eb899fbaee22c1e67f9443e9edcc2eeda0b58d8448f7c4157746b3/S3Bucket": [
Expand Down Expand Up @@ -202,6 +202,15 @@
"type": "aws:cdk:logicalId",
"data": "ServiceprincipalMap"
}
],
"HandlerCurrentVersion93FB80BFb2a9ce598bf2730613c07e406cddb6b6": [
{
"type": "aws:cdk:logicalId",
"data": "HandlerCurrentVersion93FB80BFb2a9ce598bf2730613c07e406cddb6b6",
"trace": [
"!!DESTRUCTIVE_CHANGES: WILL_DESTROY"
]
}
]
},
"displayName": "aws-cdk-codedeploy-lambda"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
},
"functionVersion": {
"Fn::GetAtt": [
"HandlerCurrentVersion93FB80BFb2a9ce598bf2730613c07e406cddb6b6",
"HandlerCurrentVersion93FB80BFf2e6129c63154d1f37c0092df295ab51",
"Version"
]
},
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-cognito/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,7 @@ The following third-party identity providers are currently supported in the CDK
- [Facebook Login](https://developers.facebook.com/docs/facebook-login/)
- [Google Login](https://developers.google.com/identity/sign-in/web/sign-in)
- [Sign In With Apple](https://developer.apple.com/sign-in-with-apple/get-started/)
- [OpenID Connect](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-oidc-idp.html)

The following code configures a user pool to federate with the third party provider, 'Login with Amazon'. The identity
provider needs to be configured with a set of credentials that the Cognito backend can use to federate with the
Expand Down
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-cognito/lib/user-pool-idps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export * from './base';
export * from './apple';
export * from './amazon';
export * from './facebook';
export * from './google';
export * from './google';
export * from './oidc';
157 changes: 157 additions & 0 deletions packages/@aws-cdk/aws-cognito/lib/user-pool-idps/oidc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
import { Names, Token } from '@aws-cdk/core';
import { Construct } from 'constructs';
import { CfnUserPoolIdentityProvider } from '../cognito.generated';
import { UserPoolIdentityProviderProps } from './base';
import { UserPoolIdentityProviderBase } from './private/user-pool-idp-base';

/**
* Properties to initialize UserPoolIdentityProviderOidc
*/
export interface UserPoolIdentityProviderOidcProps extends UserPoolIdentityProviderProps {
/**
* The client id
*/
readonly clientId: string;

/**
* The client secret
*/
readonly clientSecret: string;

/**
* Issuer URL
*/
readonly issuerUrl: string;

/**
* The name of the provider
*
* @default - the unique ID of the construct
*/
readonly name?: string;

/**
* The OAuth 2.0 scopes that you will request from OpenID Connect. Scopes are
* groups of OpenID Connect user attributes to exchange with your app.
*
* @default ['openid']
*/
readonly scopes?: string[];

/**
* Identifiers
*
* Identifiers can be used to redirect users to the correct IdP in multitenant apps.
*
* @default - no identifiers used
*/
readonly identifiers?: string[]

/**
* The method to use to request attributes
*
* @default OidcAttributeRequestMethod.GET
*/
readonly attributeRequestMethod?: OidcAttributeRequestMethod

/**
* OpenID connect endpoints
*
* @default - auto discovered with issuer URL
*/
readonly endpoints?: OidcEndpoints;
}

/**
* OpenID Connect endpoints
*/
export interface OidcEndpoints {
/**
* Authorization endpoint
*/
readonly authorization: string;

/**
* Token endpoint
*/
readonly token: string;

/**
* UserInfo endpoint
*/
readonly userInfo: string;

/**
* Jwks_uri endpoint
*/
readonly jwksUri: string;
}

/**
* The method to use to request attributes
*/
export enum OidcAttributeRequestMethod {
/** GET */
GET = 'GET',
/** POST */
POST = 'POST'
}

/**
* Represents a identity provider that integrates with OpenID Connect
* @resource AWS::Cognito::UserPoolIdentityProvider
*/
export class UserPoolIdentityProviderOidc extends UserPoolIdentityProviderBase {
public readonly providerName: string;

constructor(scope: Construct, id: string, props: UserPoolIdentityProviderOidcProps) {
super(scope, id, props);

if (props.name && !Token.isUnresolved(props.name) && (props.name.length < 3 || props.name.length > 32)) {
throw new Error(`Expected provider name to be between 3 and 32 characters, received ${props.name} (${props.name.length} characters)`);
}

const scopes = props.scopes ?? ['openid'];

const resource = new CfnUserPoolIdentityProvider(this, 'Resource', {
userPoolId: props.userPool.userPoolId,
providerName: this.getProviderName(props.name),
providerType: 'OIDC',
providerDetails: {
client_id: props.clientId,
client_secret: props.clientSecret,
authorize_scopes: scopes.join(' '),
attributes_request_method: props.attributeRequestMethod ?? OidcAttributeRequestMethod.GET,
oidc_issuer: props.issuerUrl,
authorize_url: props.endpoints?.authorization,
token_url: props.endpoints?.token,
attributes_url: props.endpoints?.userInfo,
jwks_uri: props.endpoints?.jwksUri,
},
idpIdentifiers: props.identifiers,
attributeMapping: super.configureAttributeMapping(),
});

this.providerName = super.getResourceNameAttribute(resource.ref);
}

private getProviderName(name?: string): string {
if (name) {
if (!Token.isUnresolved(name) && (name.length < 3 || name.length > 32)) {
throw new Error(`Expected provider name to be between 3 and 32 characters, received ${name} (${name.length} characters)`);
}
return name;
}

const uniqueId = Names.uniqueId(this);

if (uniqueId.length < 3) {
return `${uniqueId}oidc`;
}

if (uniqueId.length > 32) {
return uniqueId.substring(0, 16) + uniqueId.substring(uniqueId.length - 16);
}
return uniqueId;
}
}
3 changes: 2 additions & 1 deletion packages/@aws-cdk/aws-cognito/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
"props-physical-name:@aws-cdk/aws-cognito.UserPoolIdentityProviderFacebookProps",
"props-physical-name:@aws-cdk/aws-cognito.UserPoolIdentityProviderAmazonProps",
"props-physical-name:@aws-cdk/aws-cognito.UserPoolIdentityProviderGoogleProps",
"props-physical-name:@aws-cdk/aws-cognito.UserPoolIdentityProviderAppleProps"
"props-physical-name:@aws-cdk/aws-cognito.UserPoolIdentityProviderAppleProps",
"props-physical-name:@aws-cdk/aws-cognito.UserPoolIdentityProviderOidcProps"
]
},
"stability": "stable",
Expand Down
Loading