-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cognito): add analyticsConfiguration to UserPoolClient (#32862)
### Issue # (if applicable) Closes #32837 ### Reason for this change UserPoolClient in Cognito did not support the `analyticsConfiguration` property. ### Description of changes - add `analytics` property to UserPoolClientProps(interface) - add `validationAnalytics` method to UserPoolClient(Class / L2 Construct) ### Description of how you validated changes Added both unit and integration tests. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information
1 parent
51e671f
commit 1c98881
Showing
15 changed files
with
32,606 additions
and
1 deletion.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...est/integ.user-pool-client-analytics.js.snapshot/IntegUserPoolClientAnalytics.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
130 changes: 130 additions & 0 deletions
130
...t/integ.user-pool-client-analytics.js.snapshot/IntegUserPoolClientAnalytics.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
{ | ||
"Resources": { | ||
"PinpointApp": { | ||
"Type": "AWS::Pinpoint::App", | ||
"Properties": { | ||
"Name": "SamplePinpointApp" | ||
}, | ||
"UpdateReplacePolicy": "Delete", | ||
"DeletionPolicy": "Delete" | ||
}, | ||
"PoolD3F588B8": { | ||
"Type": "AWS::Cognito::UserPool", | ||
"Properties": { | ||
"AccountRecoverySetting": { | ||
"RecoveryMechanisms": [ | ||
{ | ||
"Name": "verified_phone_number", | ||
"Priority": 1 | ||
}, | ||
{ | ||
"Name": "verified_email", | ||
"Priority": 2 | ||
} | ||
] | ||
}, | ||
"AdminCreateUserConfig": { | ||
"AllowAdminCreateUserOnly": true | ||
}, | ||
"EmailVerificationMessage": "The verification code to your new account is {####}", | ||
"EmailVerificationSubject": "Verify your new account", | ||
"SmsVerificationMessage": "The verification code to your new account is {####}", | ||
"VerificationMessageTemplate": { | ||
"DefaultEmailOption": "CONFIRM_WITH_CODE", | ||
"EmailMessage": "The verification code to your new account is {####}", | ||
"EmailSubject": "Verify your new account", | ||
"SmsMessage": "The verification code to your new account is {####}" | ||
} | ||
}, | ||
"UpdateReplacePolicy": "Delete", | ||
"DeletionPolicy": "Delete" | ||
}, | ||
"PoolClient8A3E5EB7": { | ||
"Type": "AWS::Cognito::UserPoolClient", | ||
"Properties": { | ||
"AllowedOAuthFlows": [ | ||
"implicit", | ||
"code" | ||
], | ||
"AllowedOAuthFlowsUserPoolClient": true, | ||
"AllowedOAuthScopes": [ | ||
"profile", | ||
"phone", | ||
"email", | ||
"openid", | ||
"aws.cognito.signin.user.admin" | ||
], | ||
"AnalyticsConfiguration": { | ||
"ApplicationArn": { | ||
"Fn::GetAtt": [ | ||
"PinpointApp", | ||
"Arn" | ||
] | ||
} | ||
}, | ||
"CallbackURLs": [ | ||
"https://example.com" | ||
], | ||
"GenerateSecret": true, | ||
"SupportedIdentityProviders": [ | ||
"COGNITO" | ||
], | ||
"UserPoolId": { | ||
"Ref": "PoolD3F588B8" | ||
} | ||
} | ||
} | ||
}, | ||
"Outputs": { | ||
"ExportsOutputRefPoolD3F588B86FF122B2": { | ||
"Value": { | ||
"Ref": "PoolD3F588B8" | ||
}, | ||
"Export": { | ||
"Name": "IntegUserPoolClientAnalytics:ExportsOutputRefPoolD3F588B86FF122B2" | ||
} | ||
}, | ||
"ExportsOutputRefPoolClient8A3E5EB779A339F2": { | ||
"Value": { | ||
"Ref": "PoolClient8A3E5EB7" | ||
}, | ||
"Export": { | ||
"Name": "IntegUserPoolClientAnalytics:ExportsOutputRefPoolClient8A3E5EB779A339F2" | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...st/integ.user-pool-client-analytics.js.snapshot/IntegUserPoolClientAnalytics2.assets.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
177 changes: 177 additions & 0 deletions
177
.../integ.user-pool-client-analytics.js.snapshot/IntegUserPoolClientAnalytics2.template.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
{ | ||
"Resources": { | ||
"PinpointApp": { | ||
"Type": "AWS::Pinpoint::App", | ||
"Properties": { | ||
"Name": "SamplePinpointApp" | ||
}, | ||
"UpdateReplacePolicy": "Delete", | ||
"DeletionPolicy": "Delete" | ||
}, | ||
"Role1ABCC5F0": { | ||
"Type": "AWS::IAM::Role", | ||
"Properties": { | ||
"AssumeRolePolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRole", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"Service": "cognito-idp.amazonaws.com" | ||
} | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
} | ||
} | ||
}, | ||
"RoleDefaultPolicy5FFB7DAB": { | ||
"Type": "AWS::IAM::Policy", | ||
"Properties": { | ||
"PolicyDocument": { | ||
"Statement": [ | ||
{ | ||
"Action": "mobiletargeting:*", | ||
"Effect": "Allow", | ||
"Resource": "*" | ||
} | ||
], | ||
"Version": "2012-10-17" | ||
}, | ||
"PolicyName": "RoleDefaultPolicy5FFB7DAB", | ||
"Roles": [ | ||
{ | ||
"Ref": "Role1ABCC5F0" | ||
} | ||
] | ||
} | ||
}, | ||
"PoolD3F588B8": { | ||
"Type": "AWS::Cognito::UserPool", | ||
"Properties": { | ||
"AccountRecoverySetting": { | ||
"RecoveryMechanisms": [ | ||
{ | ||
"Name": "verified_phone_number", | ||
"Priority": 1 | ||
}, | ||
{ | ||
"Name": "verified_email", | ||
"Priority": 2 | ||
} | ||
] | ||
}, | ||
"AdminCreateUserConfig": { | ||
"AllowAdminCreateUserOnly": true | ||
}, | ||
"EmailVerificationMessage": "The verification code to your new account is {####}", | ||
"EmailVerificationSubject": "Verify your new account", | ||
"SmsVerificationMessage": "The verification code to your new account is {####}", | ||
"VerificationMessageTemplate": { | ||
"DefaultEmailOption": "CONFIRM_WITH_CODE", | ||
"EmailMessage": "The verification code to your new account is {####}", | ||
"EmailSubject": "Verify your new account", | ||
"SmsMessage": "The verification code to your new account is {####}" | ||
} | ||
}, | ||
"UpdateReplacePolicy": "Delete", | ||
"DeletionPolicy": "Delete" | ||
}, | ||
"Poolclient49CF16E5": { | ||
"Type": "AWS::Cognito::UserPoolClient", | ||
"Properties": { | ||
"AllowedOAuthFlows": [ | ||
"implicit", | ||
"code" | ||
], | ||
"AllowedOAuthFlowsUserPoolClient": true, | ||
"AllowedOAuthScopes": [ | ||
"profile", | ||
"phone", | ||
"email", | ||
"openid", | ||
"aws.cognito.signin.user.admin" | ||
], | ||
"AnalyticsConfiguration": { | ||
"ApplicationId": { | ||
"Ref": "PinpointApp" | ||
}, | ||
"ExternalId": { | ||
"Fn::GetAtt": [ | ||
"Role1ABCC5F0", | ||
"RoleId" | ||
] | ||
}, | ||
"RoleArn": { | ||
"Fn::GetAtt": [ | ||
"Role1ABCC5F0", | ||
"Arn" | ||
] | ||
} | ||
}, | ||
"CallbackURLs": [ | ||
"https://example.com" | ||
], | ||
"GenerateSecret": true, | ||
"SupportedIdentityProviders": [ | ||
"COGNITO" | ||
], | ||
"UserPoolId": { | ||
"Ref": "PoolD3F588B8" | ||
} | ||
} | ||
} | ||
}, | ||
"Outputs": { | ||
"ExportsOutputRefPoolD3F588B86FF122B2": { | ||
"Value": { | ||
"Ref": "PoolD3F588B8" | ||
}, | ||
"Export": { | ||
"Name": "IntegUserPoolClientAnalytics2:ExportsOutputRefPoolD3F588B86FF122B2" | ||
} | ||
}, | ||
"ExportsOutputRefPoolclient49CF16E539FEBCFA": { | ||
"Value": { | ||
"Ref": "Poolclient49CF16E5" | ||
}, | ||
"Export": { | ||
"Name": "IntegUserPoolClientAnalytics2:ExportsOutputRefPoolclient49CF16E539FEBCFA" | ||
} | ||
} | ||
}, | ||
"Parameters": { | ||
"BootstrapVersion": { | ||
"Type": "AWS::SSM::Parameter::Value<String>", | ||
"Default": "/cdk-bootstrap/hnb659fds/version", | ||
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]" | ||
} | ||
}, | ||
"Rules": { | ||
"CheckBootstrapVersion": { | ||
"Assertions": [ | ||
{ | ||
"Assert": { | ||
"Fn::Not": [ | ||
{ | ||
"Fn::Contains": [ | ||
[ | ||
"1", | ||
"2", | ||
"3", | ||
"4", | ||
"5" | ||
], | ||
{ | ||
"Ref": "BootstrapVersion" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI." | ||
} | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.