diff --git a/.changeset/metal-sheep-kneel.md b/.changeset/metal-sheep-kneel.md new file mode 100644 index 0000000000..8a0b09375d --- /dev/null +++ b/.changeset/metal-sheep-kneel.md @@ -0,0 +1,5 @@ +--- +'@aws-amplify/backend-data': minor +--- + +Update deployment strategy to use amplify tables, and allow drop/replace semantics for sandbox tables diff --git a/packages/backend-data/src/convert_schema.test.ts b/packages/backend-data/src/convert_schema.test.ts index ef982cb57f..5c98ccccf7 100644 --- a/packages/backend-data/src/convert_schema.test.ts +++ b/packages/backend-data/src/convert_schema.test.ts @@ -21,7 +21,7 @@ void describe('convertSchemaToCDK', () => { assert.deepEqual(convertedDefinition.dataSourceStrategies, { Todo: { dbType: 'DYNAMODB', - provisionStrategy: 'DEFAULT', + provisionStrategy: 'AMPLIFY_TABLE', }, }); }); @@ -48,7 +48,7 @@ void describe('convertSchemaToCDK', () => { assert.deepEqual(convertedDefinition.dataSourceStrategies, { Todo: { dbType: 'DYNAMODB', - provisionStrategy: 'DEFAULT', + provisionStrategy: 'AMPLIFY_TABLE', }, }); }); @@ -66,11 +66,11 @@ void describe('convertSchemaToCDK', () => { assert.deepEqual(convertedDefinition.dataSourceStrategies, { Todo: { dbType: 'DYNAMODB', - provisionStrategy: 'DEFAULT', + provisionStrategy: 'AMPLIFY_TABLE', }, Blog: { dbType: 'DYNAMODB', - provisionStrategy: 'DEFAULT', + provisionStrategy: 'AMPLIFY_TABLE', }, }); }); diff --git a/packages/backend-data/src/convert_schema.ts b/packages/backend-data/src/convert_schema.ts index 983226b804..d107e7fed7 100644 --- a/packages/backend-data/src/convert_schema.ts +++ b/packages/backend-data/src/convert_schema.ts @@ -27,7 +27,7 @@ export const convertSchemaToCDK = ( schema: DataSchema ): IAmplifyDataDefinition => { const dbType = 'DYNAMODB'; - const provisionStrategy = 'DEFAULT'; + const provisionStrategy = 'AMPLIFY_TABLE'; if (isModelSchema(schema)) { /** diff --git a/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json b/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json index 3419616cb1..edc58d9d4b 100644 --- a/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json +++ b/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json @@ -421,7 +421,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/b45fba916ea00e4066fd3ca9aaa82086097a91664fbaf613680b47e6b741673a.json" + "/1730e1e66f151a5d15fc5696f6de4b5e4d7649a12dc06b6ff7f3b735946b165b.json" ] ] } diff --git a/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json b/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json index fde1b444be..d344c98ddb 100644 --- a/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json +++ b/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json @@ -47,7 +47,7 @@ "ApiId" ] }, - "Expires": 1702671883 + "Expires": 1702675657 } }, "amplifyDataGraphQLAPINONEDS684BF699": { @@ -64,6 +64,41 @@ "Type": "NONE" } }, + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPI42A6FA33", + "ApiId" + ] + } + }, + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/35e06ca29c28793a345d0a1e4ed0a16bf7bad8a644c30c06a02b4218f7be6aa6.json" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, "amplifyDataTodoNestedStackTodoNestedStackResource551CEA56": { "Type": "AWS::CloudFormation::Stack", "Properties": { @@ -83,6 +118,12 @@ "DynamoDBEnableServerSideEncryption": { "Ref": "DynamoDBEnableServerSideEncryption" }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Fn::GetAtt": [ + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833", + "Outputs.amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn" + ] + }, "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { "Fn::GetAtt": [ "amplifyDataGraphQLAPI42A6FA33", @@ -121,7 +162,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/ee42b8a4399f9441d96d64d8a6914641cd6882338283da6ec16b07cd40ce4a2a.json" + "/7feef61ce2e7746b3d7700aa837fa419f347b204061c8e32f444e10623738309.json" ] ] } diff --git a/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json b/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json new file mode 100644 index 0000000000..b342d0c674 --- /dev/null +++ b/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json @@ -0,0 +1,987 @@ +{ + "Resources": { + "CreateUpdateDeleteTablesPolicyB7B6ADB5": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:CreateTable", + "dynamodb:UpdateTable", + "dynamodb:DeleteTable", + "dynamodb:DescribeTable", + "dynamodb:DescribeContinuousBackups", + "dynamodb:DescribeTimeToLive", + "dynamodb:UpdateContinuousBackups", + "dynamodb:UpdateTimeToLive" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/*-${apiId}-${envName}", + { + "apiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "envName": "NONE" + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CreateUpdateDeleteTablesPolicyB7B6ADB5", + "Roles": [ + { + "Ref": "TableManagerOnEventHandlerServiceRoleD69E8A0C" + }, + { + "Ref": "TableManagerIsCompleteHandlerServiceRole73EE73E4" + } + ] + } + }, + "TableManagerOnEventHandlerServiceRoleD69E8A0C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerOnEventHandler8779E150": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C" + ] + }, + "TableManagerIsCompleteHandlerServiceRole73EE73E4": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerIsCompleteHandler63238667": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4" + ] + }, + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + } + ] + } + }, + "TableManagerCustomProviderframeworkonEvent1DFC2ECC": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onEvent (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + "WAITER_STATE_MACHINE_ARN": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + }, + "Handler": "framework.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + ] + }, + "TableManagerCustomProviderframeworkonEventLogRetention3E5C45E7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonEvent1DFC2ECC" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + } + ] + } + }, + "TableManagerCustomProviderframeworkisComplete2E51021B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - isComplete (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + ] + }, + "TableManagerCustomProviderframeworkisCompleteLogRetentionBED1D9F7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkisComplete2E51021B" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutC98D33BB": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onTimeout (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.onTimeout", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + ] + }, + "TableManagerCustomProviderframeworkonTimeoutLogRetention3A93F510": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutC98D33BB" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderwaiterstatemachineRole9616A97E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": { + "Fn::FindInMap": [ + "ServiceprincipalMap", + { + "Ref": "AWS::Region" + }, + "states" + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "Roles": [ + { + "Ref": "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + } + ] + } + }, + "TableManagerCustomProviderwaiterstatemachine46E6141A": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"framework-isComplete-task\",\"States\":{\"framework-isComplete-task\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"States.ALL\"],\"IntervalSeconds\":30,\"MaxAttempts\":240,\"BackoffRate\":1}],\"Catch\":[{\"ErrorEquals\":[\"States.ALL\"],\"Next\":\"framework-onTimeout-task\"}],\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + "\"},\"framework-onTimeout-task\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + "\"}}}" + ] + ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "TableManagerCustomProviderwaiterstatemachineRole9616A97E", + "Arn" + ] + } + }, + "DependsOn": [ + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + ] + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:PutRetentionPolicy", + "logs:DeleteRetentionPolicy" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "Roles": [ + { + "Ref": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Handler": "index.handler", + "Runtime": "nodejs18.x", + "Timeout": 900, + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "5bc602ecde93c947efe5899ae355f999986a1acbe610b1c0b9c468d738857555.zip" + }, + "Role": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", + "Arn" + ] + } + }, + "DependsOn": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + ] + } + }, + "Mappings": { + "ServiceprincipalMap": { + "af-south-1": { + "states": "states.af-south-1.amazonaws.com" + }, + "ap-east-1": { + "states": "states.ap-east-1.amazonaws.com" + }, + "ap-northeast-1": { + "states": "states.ap-northeast-1.amazonaws.com" + }, + "ap-northeast-2": { + "states": "states.ap-northeast-2.amazonaws.com" + }, + "ap-northeast-3": { + "states": "states.ap-northeast-3.amazonaws.com" + }, + "ap-south-1": { + "states": "states.ap-south-1.amazonaws.com" + }, + "ap-south-2": { + "states": "states.ap-south-2.amazonaws.com" + }, + "ap-southeast-1": { + "states": "states.ap-southeast-1.amazonaws.com" + }, + "ap-southeast-2": { + "states": "states.ap-southeast-2.amazonaws.com" + }, + "ap-southeast-3": { + "states": "states.ap-southeast-3.amazonaws.com" + }, + "ap-southeast-4": { + "states": "states.ap-southeast-4.amazonaws.com" + }, + "ca-central-1": { + "states": "states.ca-central-1.amazonaws.com" + }, + "cn-north-1": { + "states": "states.cn-north-1.amazonaws.com" + }, + "cn-northwest-1": { + "states": "states.cn-northwest-1.amazonaws.com" + }, + "eu-central-1": { + "states": "states.eu-central-1.amazonaws.com" + }, + "eu-central-2": { + "states": "states.eu-central-2.amazonaws.com" + }, + "eu-north-1": { + "states": "states.eu-north-1.amazonaws.com" + }, + "eu-south-1": { + "states": "states.eu-south-1.amazonaws.com" + }, + "eu-south-2": { + "states": "states.eu-south-2.amazonaws.com" + }, + "eu-west-1": { + "states": "states.eu-west-1.amazonaws.com" + }, + "eu-west-2": { + "states": "states.eu-west-2.amazonaws.com" + }, + "eu-west-3": { + "states": "states.eu-west-3.amazonaws.com" + }, + "il-central-1": { + "states": "states.il-central-1.amazonaws.com" + }, + "me-central-1": { + "states": "states.me-central-1.amazonaws.com" + }, + "me-south-1": { + "states": "states.me-south-1.amazonaws.com" + }, + "sa-east-1": { + "states": "states.sa-east-1.amazonaws.com" + }, + "us-east-1": { + "states": "states.us-east-1.amazonaws.com" + }, + "us-east-2": { + "states": "states.us-east-2.amazonaws.com" + }, + "us-gov-east-1": { + "states": "states.us-gov-east-1.amazonaws.com" + }, + "us-gov-west-1": { + "states": "states.us-gov-west-1.amazonaws.com" + }, + "us-iso-east-1": { + "states": "states.amazonaws.com" + }, + "us-iso-west-1": { + "states": "states.amazonaws.com" + }, + "us-isob-east-1": { + "states": "states.amazonaws.com" + }, + "us-west-1": { + "states": "states.us-west-1.amazonaws.com" + }, + "us-west-2": { + "states": "states.us-west-2.amazonaws.com" + } + } + }, + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Type": "String" + } + }, + "Outputs": { + "amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn": { + "Value": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEvent1DFC2ECC", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json b/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json index 8f8f83f1d2..c6b93f8d9a 100644 --- a/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json +++ b/packages/create-amplify/templates/basic-auth-data/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json @@ -37,6 +37,9 @@ ], "Description": "Enable server side encryption powered by KMS." }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Type": "String" + }, "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { "Type": "String" }, @@ -90,42 +93,37 @@ } }, "Resources": { - "TodoTable585F1D6B": { - "Type": "AWS::DynamoDB::Table", + "TodoTable": { + "Type": "Custom::AmplifyDynamoDBTable", "Properties": { - "AttributeDefinitions": [ + "ServiceToken": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E" + }, + "tableName": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "attributeDefinitions": [ { - "AttributeName": "id", - "AttributeType": "S" + "attributeName": "id", + "attributeType": "S" } ], - "BillingMode": { - "Fn::If": [ - "ShouldUsePayPerRequestBilling", - "PAY_PER_REQUEST", - { - "Ref": "AWS::NoValue" - } - ] - }, - "KeySchema": [ + "keySchema": [ { - "AttributeName": "id", - "KeyType": "HASH" + "attributeName": "id", + "keyType": "HASH" } ], - "PointInTimeRecoverySpecification": { - "Fn::If": [ - "ShouldUsePointInTimeRecovery", - { - "PointInTimeRecoveryEnabled": true - }, - { - "Ref": "AWS::NoValue" - } - ] - }, - "ProvisionedThroughput": { + "provisionedThroughput": { "Fn::If": [ "ShouldUsePayPerRequestBilling", { @@ -141,8 +139,8 @@ } ] }, - "SSESpecification": { - "SSEEnabled": { + "sseSpecification": { + "sseEnabled": { "Fn::If": [ "ShouldUseServerSideEncryption", true, @@ -150,19 +148,29 @@ ] } }, - "StreamSpecification": { - "StreamViewType": "NEW_AND_OLD_IMAGES" + "streamSpecification": { + "streamViewType": "NEW_AND_OLD_IMAGES" }, - "TableName": { - "Fn::Join": [ - "", - [ - "Todo-", - { - "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" - }, - "-NONE" - ] + "allowDestructiveGraphqlSchemaUpdates": false, + "replaceTableUponGsiUpdate": false, + "pointInTimeRecoverySpecification": { + "Fn::If": [ + "ShouldUsePointInTimeRecovery", + { + "PointInTimeRecoveryEnabled": true + }, + { + "Ref": "AWS::NoValue" + } + ] + }, + "billingMode": { + "Fn::If": [ + "ShouldUsePayPerRequestBilling", + "PAY_PER_REQUEST", + { + "Ref": "AWS::NoValue" + } ] } }, @@ -222,8 +230,8 @@ "Resource": [ { "Fn::GetAtt": [ - "TodoTable585F1D6B", - "Arn" + "TodoTable", + "TableArn" ] }, { @@ -322,7 +330,30 @@ "Ref": "AWS::Region" }, "TableName": { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] } }, "Name": "TodoTable", @@ -460,7 +491,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -612,7 +666,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -787,7 +864,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -970,7 +1070,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -1130,7 +1253,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -1590,5 +1736,57 @@ "TypeName": "Todo" } } + }, + "Outputs": { + "GetAttTodoTableStreamArn": { + "Description": "Your DynamoDB table StreamArn.", + "Value": { + "Fn::GetAtt": [ + "TodoTable", + "TableStreamArn" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:StreamArn" + ] + ] + } + } + }, + "GetAttTodoTableName": { + "Description": "Your DynamoDB table name.", + "Value": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:Name" + ] + ] + } + } + } } } \ No newline at end of file diff --git a/packages/integration-tests/test-projects/data-iterative-deploy/amplify/backend.ts b/packages/integration-tests/test-projects/data-iterative-deploy/amplify/backend.ts new file mode 100644 index 0000000000..031b6539ed --- /dev/null +++ b/packages/integration-tests/test-projects/data-iterative-deploy/amplify/backend.ts @@ -0,0 +1,4 @@ +import { defineBackend } from '@aws-amplify/backend'; +import { data } from './data/resource.js'; + +defineBackend({ data }); diff --git a/packages/integration-tests/test-projects/data-iterative-deploy/amplify/data/resource.ts b/packages/integration-tests/test-projects/data-iterative-deploy/amplify/data/resource.ts new file mode 100644 index 0000000000..b80deab7b4 --- /dev/null +++ b/packages/integration-tests/test-projects/data-iterative-deploy/amplify/data/resource.ts @@ -0,0 +1,10 @@ +import { defineData } from '@aws-amplify/backend'; + +export const data = defineData({ + schema: /* GraphQL */ ` + type Todo @model { + field1: String! + field2: String! + } + `, +}); diff --git a/packages/integration-tests/test-projects/data-iterative-deploy/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json b/packages/integration-tests/test-projects/data-iterative-deploy/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json new file mode 100644 index 0000000000..74bb4b0916 --- /dev/null +++ b/packages/integration-tests/test-projects/data-iterative-deploy/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json @@ -0,0 +1,352 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyPipelineDeploy\",\"createdWith\":\"0.5.1\",\"stackType\":\"root\",\"metadata\":{}}", + "Metadata": { + "AWS::Amplify::Platform": { + "version": "1", + "stackOutputs": [ + "deploymentType", + "region" + ] + }, + "AWS::Amplify::GraphQL": { + "version": "1", + "stackOutputs": [ + "awsAppsyncApiId", + "awsAppsyncApiEndpoint", + "awsAppsyncAuthenticationType", + "awsAppsyncRegion", + "amplifyApiModelSchemaS3Uri", + "awsAppsyncApiKey" + ] + } + }, + "Outputs": { + "deploymentType": { + "Value": "branch" + }, + "region": { + "Value": { + "Ref": "AWS::Region" + } + }, + "awsAppsyncApiId": { + "Value": { + "Fn::GetAtt": [ + "data7552DF31", + "Outputs.amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + ] + } + }, + "awsAppsyncApiEndpoint": { + "Value": { + "Fn::GetAtt": [ + "data7552DF31", + "Outputs.amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEGraphQLUrl" + ] + } + }, + "awsAppsyncAuthenticationType": { + "Value": "API_KEY" + }, + "awsAppsyncRegion": { + "Value": { + "Ref": "AWS::Region" + } + }, + "amplifyApiModelSchemaS3Uri": { + "Value": { + "Fn::Join": [ + "", + [ + "s3://", + { + "Fn::GetAtt": [ + "data7552DF31", + "Outputs.amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucket01B64A21Ref" + ] + }, + "/model-schema.graphql" + ] + ] + } + }, + "awsAppsyncApiKey": { + "Value": { + "Fn::GetAtt": [ + "data7552DF31", + "Outputs.amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPIDefaultApiKey346D40FDApiKey" + ] + } + } + }, + "Resources": { + "AmplifyBranchLinkerCustomResourceLambdaServiceRole3DDCBC03": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "AmplifyBranchLinkerCustomResourceLambdaServiceRoleDefaultPolicy86099CA1": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "amplify:GetBranch", + "amplify:UpdateBranch" + ], + "Effect": "Allow", + "Resource": "arn:aws:amplify:*:*:apps/testAppId/branches/testBranchName" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AmplifyBranchLinkerCustomResourceLambdaServiceRoleDefaultPolicy86099CA1", + "Roles": [ + { + "Ref": "AmplifyBranchLinkerCustomResourceLambdaServiceRole3DDCBC03" + } + ] + } + }, + "AmplifyBranchLinkerCustomResourceLambda582AC093": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "c5f154e6312b93b44d21e0e9e0f5ba13f4b731c9e38bcb30c6f368f1195c88e2.zip" + }, + "Environment": { + "Variables": { + "AWS_NODEJS_CONNECTION_REUSE_ENABLED": "1" + } + }, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "AmplifyBranchLinkerCustomResourceLambdaServiceRole3DDCBC03", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 10 + }, + "DependsOn": [ + "AmplifyBranchLinkerCustomResourceLambdaServiceRoleDefaultPolicy86099CA1", + "AmplifyBranchLinkerCustomResourceLambdaServiceRole3DDCBC03" + ] + }, + "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRole92A035EB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRoleDefaultPolicy38AAE412": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "AmplifyBranchLinkerCustomResourceLambda582AC093", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "AmplifyBranchLinkerCustomResourceLambda582AC093", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRoleDefaultPolicy38AAE412", + "Roles": [ + { + "Ref": "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRole92A035EB" + } + ] + } + }, + "AmplifyBranchLinkerCustomResourceProviderframeworkonEvent3B23F900": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onEvent (amplify-testAppId-testBranchName-branch-7d6f6c854a/AmplifyBranchLinker/CustomResourceProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "AmplifyBranchLinkerCustomResourceLambda582AC093", + "Arn" + ] + } + } + }, + "Handler": "framework.onEvent", + "Role": { + "Fn::GetAtt": [ + "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRole92A035EB", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRoleDefaultPolicy38AAE412", + "AmplifyBranchLinkerCustomResourceProviderframeworkonEventServiceRole92A035EB" + ] + }, + "AmplifyBranchLinkerCustomResource96E36FC1": { + "Type": "Custom::AmplifyBranchLinkerResource", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "AmplifyBranchLinkerCustomResourceProviderframeworkonEvent3B23F900", + "Arn" + ] + }, + "appId": "testAppId", + "branchName": "testBranchName" + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "data7552DF31": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/44cc9d129e953fc61a40ee91f3028a2c7ed8acc94faa7dfd8065ae29f7cd1925.json" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + } + }, + "Parameters": { + "BootstrapVersion": { + "Type": "AWS::SSM::Parameter::Value", + "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." + } + ] + } + } +} \ No newline at end of file diff --git a/packages/integration-tests/test-projects/data-iterative-deploy/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json b/packages/integration-tests/test-projects/data-iterative-deploy/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json new file mode 100644 index 0000000000..857691049b --- /dev/null +++ b/packages/integration-tests/test-projects/data-iterative-deploy/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json @@ -0,0 +1,568 @@ +{ + "Description": "{\"createdOn\":\"Mac\",\"createdBy\":\"AmplifyCDK\",\"createdWith\":\"1.4.0\",\"stackType\":\"api-AppSync\",\"metadata\":{}}", + "Resources": { + "amplifyDataGraphQLAPI42A6FA33": { + "Type": "AWS::AppSync::GraphQLApi", + "Properties": { + "AuthenticationType": "API_KEY", + "Name": "amplifyData" + } + }, + "amplifyDataGraphQLAPITransformerSchemaFF50A789": { + "Type": "AWS::AppSync::GraphQLSchema", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPI42A6FA33", + "ApiId" + ] + }, + "DefinitionS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a8641fe7f3d1b191af1863ef36013258b1bfc2dd6925fd5e96a4d7e4da8ff397.graphql" + } + } + }, + "amplifyDataGraphQLAPIDefaultApiKey1C8ED374": { + "Type": "AWS::AppSync::ApiKey", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPI42A6FA33", + "ApiId" + ] + }, + "Expires": 1700688447 + } + }, + "amplifyDataGraphQLAPINONEDS684BF699": { + "Type": "AWS::AppSync::DataSource", + "Properties": { + "ApiId": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPI42A6FA33", + "ApiId" + ] + }, + "Description": "None Data Source for Pipeline functions", + "Name": "NONE_DS", + "Type": "NONE" + } + }, + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPI42A6FA33", + "ApiId" + ] + } + }, + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/35e06ca29c28793a345d0a1e4ed0a16bf7bad8a644c30c06a02b4218f7be6aa6.json" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "amplifyDataTodoNestedStackTodoNestedStackResource551CEA56": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "DynamoDBModelTableReadIOPS": { + "Ref": "DynamoDBModelTableReadIOPS" + }, + "DynamoDBModelTableWriteIOPS": { + "Ref": "DynamoDBModelTableWriteIOPS" + }, + "DynamoDBBillingMode": { + "Ref": "DynamoDBBillingMode" + }, + "DynamoDBEnablePointInTimeRecovery": { + "Ref": "DynamoDBEnablePointInTimeRecovery" + }, + "DynamoDBEnableServerSideEncryption": { + "Ref": "DynamoDBEnableServerSideEncryption" + }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Fn::GetAtt": [ + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833", + "Outputs.amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn" + ] + }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPI42A6FA33", + "ApiId" + ] + }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPINONEDS684BF699", + "Name" + ] + } + }, + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/b2592dc0925350164d369b9756628f4e37c379d41cabf3012d22754ae7b343f8.json" + ] + ] + } + }, + "DependsOn": [ + "amplifyDataGraphQLAPITransformerSchemaFF50A789" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucket9CCB4ACA": { + "Type": "AWS::S3::Bucket", + "Properties": { + "Tags": [ + { + "Key": "aws-cdk:auto-delete-objects", + "Value": "true" + }, + { + "Key": "aws-cdk:cr-owned:6d332485", + "Value": "true" + } + ] + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucketPolicyF1C1C548": { + "Type": "AWS::S3::BucketPolicy", + "Properties": { + "Bucket": { + "Ref": "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucket9CCB4ACA" + }, + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:PutBucketPolicy", + "s3:GetBucket*", + "s3:List*", + "s3:DeleteObject*" + ], + "Effect": "Allow", + "Principal": { + "AWS": { + "Fn::GetAtt": [ + "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", + "Arn" + ] + } + }, + "Resource": [ + { + "Fn::GetAtt": [ + "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucket9CCB4ACA", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucket9CCB4ACA", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + } + } + }, + "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucketAutoDeleteObjectsCustomResource437F26F5": { + "Type": "Custom::S3AutoDeleteObjects", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F", + "Arn" + ] + }, + "BucketName": { + "Ref": "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucket9CCB4ACA" + } + }, + "DependsOn": [ + "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucketPolicyF1C1C548" + ], + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsDeploymentAwsCliLayerE322F905": { + "Type": "AWS::Lambda::LayerVersion", + "Properties": { + "Content": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "3fb6287214999ddeafa7cd0e3e58bc5144c8678bb720f3b5e45e8fd32f333eb3.zip" + }, + "Description": "/opt/awscli/aws" + } + }, + "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsDeploymentCustomResource1536MiB21775929": { + "Type": "Custom::CDKBucketDeployment", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1536MiBC5D8AB21", + "Arn" + ] + }, + "SourceBucketNames": [ + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ], + "SourceObjectKeys": [ + "91ec9b176ef4ddf3162a347d9075f0dbbf1a7f1202ef2890ba030f5f1c1438a5.zip" + ], + "SourceMarkers": [ + {} + ], + "DestinationBucketName": { + "Ref": "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucket9CCB4ACA" + }, + "Prune": true + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Version": "2012-10-17", + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ] + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + } + ] + } + }, + "CustomS3AutoDeleteObjectsCustomResourceProviderHandler9D90184F": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "b7f33614a69548d6bafe224d751a7ef238cde19097415e553fe8b63a4c8fd8a6.zip" + }, + "Timeout": 900, + "MemorySize": 128, + "Handler": "index.handler", + "Role": { + "Fn::GetAtt": [ + "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Description": { + "Fn::Join": [ + "", + [ + "Lambda function for auto-deleting objects in ", + { + "Ref": "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucket9CCB4ACA" + }, + " S3 bucket." + ] + ] + } + }, + "DependsOn": [ + "CustomS3AutoDeleteObjectsCustomResourceProviderRole3B1BD092" + ] + }, + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1536MiBServiceRoleA41FC8C2": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1536MiBServiceRoleDefaultPolicyFF1C635B": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + } + ] + ] + }, + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":s3:::", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/*" + ] + ] + } + ] + }, + { + "Action": [ + "s3:GetObject*", + "s3:GetBucket*", + "s3:List*", + "s3:DeleteObject*", + "s3:PutObject", + "s3:PutObjectLegalHold", + "s3:PutObjectRetention", + "s3:PutObjectTagging", + "s3:PutObjectVersionTagging", + "s3:Abort*" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucket9CCB4ACA", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucket9CCB4ACA", + "Arn" + ] + }, + "/*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1536MiBServiceRoleDefaultPolicyFF1C635B", + "Roles": [ + { + "Ref": "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1536MiBServiceRoleA41FC8C2" + } + ] + } + }, + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1536MiBC5D8AB21": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "9eb41a5505d37607ac419321497a4f8c21cf0ee1f9b4a6b29aa04301aea5c7fd.zip" + }, + "Environment": { + "Variables": { + "AWS_CA_BUNDLE": "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" + } + }, + "Handler": "index.handler", + "Layers": [ + { + "Ref": "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsDeploymentAwsCliLayerE322F905" + } + ], + "MemorySize": 1536, + "Role": { + "Fn::GetAtt": [ + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1536MiBServiceRoleA41FC8C2", + "Arn" + ] + }, + "Runtime": "python3.9", + "Timeout": 900 + }, + "DependsOn": [ + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1536MiBServiceRoleDefaultPolicyFF1C635B", + "CustomCDKBucketDeployment8693BB64968944B69AAFB0CC9EB8756C1536MiBServiceRoleA41FC8C2" + ] + } + }, + "Parameters": { + "DynamoDBModelTableReadIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of read IOPS the table should support." + }, + "DynamoDBModelTableWriteIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of write IOPS the table should support." + }, + "DynamoDBBillingMode": { + "Type": "String", + "Default": "PAY_PER_REQUEST", + "AllowedValues": [ + "PAY_PER_REQUEST", + "PROVISIONED" + ], + "Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes." + }, + "DynamoDBEnablePointInTimeRecovery": { + "Type": "String", + "Default": "false", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Whether to enable Point in Time Recovery on the table." + }, + "DynamoDBEnableServerSideEncryption": { + "Type": "String", + "Default": "true", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Enable server side encryption powered by KMS." + } + }, + "Outputs": { + "amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Value": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPI42A6FA33", + "ApiId" + ] + } + }, + "amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEGraphQLUrl": { + "Value": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPI42A6FA33", + "GraphQLUrl" + ] + } + }, + "amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucket01B64A21Ref": { + "Value": { + "Ref": "amplifyDataAmplifyCodegenAssetsAmplifyCodegenAssetsBucket9CCB4ACA" + } + }, + "amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPIDefaultApiKey346D40FDApiKey": { + "Value": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPIDefaultApiKey1C8ED374", + "ApiKey" + ] + } + } + } +} \ No newline at end of file diff --git a/packages/integration-tests/test-projects/data-iterative-deploy/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json b/packages/integration-tests/test-projects/data-iterative-deploy/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json new file mode 100644 index 0000000000..b342d0c674 --- /dev/null +++ b/packages/integration-tests/test-projects/data-iterative-deploy/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json @@ -0,0 +1,987 @@ +{ + "Resources": { + "CreateUpdateDeleteTablesPolicyB7B6ADB5": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:CreateTable", + "dynamodb:UpdateTable", + "dynamodb:DeleteTable", + "dynamodb:DescribeTable", + "dynamodb:DescribeContinuousBackups", + "dynamodb:DescribeTimeToLive", + "dynamodb:UpdateContinuousBackups", + "dynamodb:UpdateTimeToLive" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/*-${apiId}-${envName}", + { + "apiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "envName": "NONE" + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CreateUpdateDeleteTablesPolicyB7B6ADB5", + "Roles": [ + { + "Ref": "TableManagerOnEventHandlerServiceRoleD69E8A0C" + }, + { + "Ref": "TableManagerIsCompleteHandlerServiceRole73EE73E4" + } + ] + } + }, + "TableManagerOnEventHandlerServiceRoleD69E8A0C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerOnEventHandler8779E150": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C" + ] + }, + "TableManagerIsCompleteHandlerServiceRole73EE73E4": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerIsCompleteHandler63238667": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4" + ] + }, + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + } + ] + } + }, + "TableManagerCustomProviderframeworkonEvent1DFC2ECC": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onEvent (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + "WAITER_STATE_MACHINE_ARN": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + }, + "Handler": "framework.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + ] + }, + "TableManagerCustomProviderframeworkonEventLogRetention3E5C45E7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonEvent1DFC2ECC" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + } + ] + } + }, + "TableManagerCustomProviderframeworkisComplete2E51021B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - isComplete (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + ] + }, + "TableManagerCustomProviderframeworkisCompleteLogRetentionBED1D9F7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkisComplete2E51021B" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutC98D33BB": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onTimeout (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.onTimeout", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + ] + }, + "TableManagerCustomProviderframeworkonTimeoutLogRetention3A93F510": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutC98D33BB" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderwaiterstatemachineRole9616A97E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": { + "Fn::FindInMap": [ + "ServiceprincipalMap", + { + "Ref": "AWS::Region" + }, + "states" + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "Roles": [ + { + "Ref": "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + } + ] + } + }, + "TableManagerCustomProviderwaiterstatemachine46E6141A": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"framework-isComplete-task\",\"States\":{\"framework-isComplete-task\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"States.ALL\"],\"IntervalSeconds\":30,\"MaxAttempts\":240,\"BackoffRate\":1}],\"Catch\":[{\"ErrorEquals\":[\"States.ALL\"],\"Next\":\"framework-onTimeout-task\"}],\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + "\"},\"framework-onTimeout-task\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + "\"}}}" + ] + ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "TableManagerCustomProviderwaiterstatemachineRole9616A97E", + "Arn" + ] + } + }, + "DependsOn": [ + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + ] + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:PutRetentionPolicy", + "logs:DeleteRetentionPolicy" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "Roles": [ + { + "Ref": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Handler": "index.handler", + "Runtime": "nodejs18.x", + "Timeout": 900, + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "5bc602ecde93c947efe5899ae355f999986a1acbe610b1c0b9c468d738857555.zip" + }, + "Role": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", + "Arn" + ] + } + }, + "DependsOn": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + ] + } + }, + "Mappings": { + "ServiceprincipalMap": { + "af-south-1": { + "states": "states.af-south-1.amazonaws.com" + }, + "ap-east-1": { + "states": "states.ap-east-1.amazonaws.com" + }, + "ap-northeast-1": { + "states": "states.ap-northeast-1.amazonaws.com" + }, + "ap-northeast-2": { + "states": "states.ap-northeast-2.amazonaws.com" + }, + "ap-northeast-3": { + "states": "states.ap-northeast-3.amazonaws.com" + }, + "ap-south-1": { + "states": "states.ap-south-1.amazonaws.com" + }, + "ap-south-2": { + "states": "states.ap-south-2.amazonaws.com" + }, + "ap-southeast-1": { + "states": "states.ap-southeast-1.amazonaws.com" + }, + "ap-southeast-2": { + "states": "states.ap-southeast-2.amazonaws.com" + }, + "ap-southeast-3": { + "states": "states.ap-southeast-3.amazonaws.com" + }, + "ap-southeast-4": { + "states": "states.ap-southeast-4.amazonaws.com" + }, + "ca-central-1": { + "states": "states.ca-central-1.amazonaws.com" + }, + "cn-north-1": { + "states": "states.cn-north-1.amazonaws.com" + }, + "cn-northwest-1": { + "states": "states.cn-northwest-1.amazonaws.com" + }, + "eu-central-1": { + "states": "states.eu-central-1.amazonaws.com" + }, + "eu-central-2": { + "states": "states.eu-central-2.amazonaws.com" + }, + "eu-north-1": { + "states": "states.eu-north-1.amazonaws.com" + }, + "eu-south-1": { + "states": "states.eu-south-1.amazonaws.com" + }, + "eu-south-2": { + "states": "states.eu-south-2.amazonaws.com" + }, + "eu-west-1": { + "states": "states.eu-west-1.amazonaws.com" + }, + "eu-west-2": { + "states": "states.eu-west-2.amazonaws.com" + }, + "eu-west-3": { + "states": "states.eu-west-3.amazonaws.com" + }, + "il-central-1": { + "states": "states.il-central-1.amazonaws.com" + }, + "me-central-1": { + "states": "states.me-central-1.amazonaws.com" + }, + "me-south-1": { + "states": "states.me-south-1.amazonaws.com" + }, + "sa-east-1": { + "states": "states.sa-east-1.amazonaws.com" + }, + "us-east-1": { + "states": "states.us-east-1.amazonaws.com" + }, + "us-east-2": { + "states": "states.us-east-2.amazonaws.com" + }, + "us-gov-east-1": { + "states": "states.us-gov-east-1.amazonaws.com" + }, + "us-gov-west-1": { + "states": "states.us-gov-west-1.amazonaws.com" + }, + "us-iso-east-1": { + "states": "states.amazonaws.com" + }, + "us-iso-west-1": { + "states": "states.amazonaws.com" + }, + "us-isob-east-1": { + "states": "states.amazonaws.com" + }, + "us-west-1": { + "states": "states.us-west-1.amazonaws.com" + }, + "us-west-2": { + "states": "states.us-west-2.amazonaws.com" + } + } + }, + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Type": "String" + } + }, + "Outputs": { + "amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn": { + "Value": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEvent1DFC2ECC", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/packages/integration-tests/test-projects/data-iterative-deploy/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json b/packages/integration-tests/test-projects/data-iterative-deploy/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json new file mode 100644 index 0000000000..a36d4b3125 --- /dev/null +++ b/packages/integration-tests/test-projects/data-iterative-deploy/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json @@ -0,0 +1,1235 @@ +{ + "Parameters": { + "DynamoDBModelTableReadIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of read IOPS the table should support." + }, + "DynamoDBModelTableWriteIOPS": { + "Type": "Number", + "Default": 5, + "Description": "The number of write IOPS the table should support." + }, + "DynamoDBBillingMode": { + "Type": "String", + "Default": "PAY_PER_REQUEST", + "AllowedValues": [ + "PAY_PER_REQUEST", + "PROVISIONED" + ], + "Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes." + }, + "DynamoDBEnablePointInTimeRecovery": { + "Type": "String", + "Default": "false", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Whether to enable Point in Time Recovery on the table." + }, + "DynamoDBEnableServerSideEncryption": { + "Type": "String", + "Default": "true", + "AllowedValues": [ + "true", + "false" + ], + "Description": "Enable server side encryption powered by KMS." + }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Type": "String" + }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Type": "String" + }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name": { + "Type": "String" + } + }, + "Conditions": { + "HasEnvironmentParameter": { + "Fn::Not": [ + { + "Fn::Equals": [ + "NONE", + "NONE" + ] + } + ] + }, + "ShouldUseServerSideEncryption": { + "Fn::Equals": [ + { + "Ref": "DynamoDBEnableServerSideEncryption" + }, + "true" + ] + }, + "ShouldUsePayPerRequestBilling": { + "Fn::Equals": [ + { + "Ref": "DynamoDBBillingMode" + }, + "PAY_PER_REQUEST" + ] + }, + "ShouldUsePointInTimeRecovery": { + "Fn::Equals": [ + { + "Ref": "DynamoDBEnablePointInTimeRecovery" + }, + "true" + ] + } + }, + "Resources": { + "TodoTable": { + "Type": "Custom::AmplifyDynamoDBTable", + "Properties": { + "ServiceToken": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E" + }, + "tableName": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "attributeDefinitions": [ + { + "attributeName": "id", + "attributeType": "S" + } + ], + "keySchema": [ + { + "attributeName": "id", + "keyType": "HASH" + } + ], + "provisionedThroughput": { + "Fn::If": [ + "ShouldUsePayPerRequestBilling", + { + "Ref": "AWS::NoValue" + }, + { + "ReadCapacityUnits": { + "Ref": "DynamoDBModelTableReadIOPS" + }, + "WriteCapacityUnits": { + "Ref": "DynamoDBModelTableWriteIOPS" + } + } + ] + }, + "sseSpecification": { + "sseEnabled": { + "Fn::If": [ + "ShouldUseServerSideEncryption", + true, + false + ] + } + }, + "streamSpecification": { + "streamViewType": "NEW_AND_OLD_IMAGES" + }, + "allowDestructiveGraphqlSchemaUpdates": false, + "replaceTableUponGsiUpdate": false, + "pointInTimeRecoverySpecification": { + "Fn::If": [ + "ShouldUsePointInTimeRecovery", + { + "PointInTimeRecoveryEnabled": true + }, + { + "Ref": "AWS::NoValue" + } + ] + }, + "billingMode": { + "Fn::If": [ + "ShouldUsePayPerRequestBilling", + "PAY_PER_REQUEST", + { + "Ref": "AWS::NoValue" + } + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, + "TodoIAMRole2DA8E66E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "appsync.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "RoleName": { + "Fn::Join": [ + "", + [ + "TodoIAMRolecfd440-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + } + } + }, + "TodoIAMRoleDefaultPolicy7BBBF45B": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:BatchGetItem", + "dynamodb:GetRecords", + "dynamodb:GetShardIterator", + "dynamodb:Query", + "dynamodb:GetItem", + "dynamodb:Scan", + "dynamodb:ConditionCheckItem", + "dynamodb:BatchWriteItem", + "dynamodb:PutItem", + "dynamodb:UpdateItem", + "dynamodb:DeleteItem", + "dynamodb:DescribeTable" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + }, + { + "Ref": "AWS::NoValue" + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TodoIAMRoleDefaultPolicy7BBBF45B", + "Roles": [ + { + "Ref": "TodoIAMRole2DA8E66E" + } + ] + } + }, + "DynamoDBAccess71ABE5AE": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:BatchGetItem", + "dynamodb:BatchWriteItem", + "dynamodb:PutItem", + "dynamodb:DeleteItem", + "dynamodb:GetItem", + "dynamodb:Scan", + "dynamodb:Query", + "dynamodb:UpdateItem" + ], + "Effect": "Allow", + "Resource": [ + { + "Fn::Sub": [ + "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tablename}", + { + "tablename": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + } + } + ] + }, + { + "Fn::Sub": [ + "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/${tablename}/*", + { + "tablename": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + } + } + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "DynamoDBAccess71ABE5AE", + "Roles": [ + { + "Ref": "TodoIAMRole2DA8E66E" + } + ] + } + }, + "TodoDataSource": { + "Type": "AWS::AppSync::DataSource", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DynamoDBConfig": { + "AwsRegion": { + "Ref": "AWS::Region" + }, + "TableName": { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] + } + }, + "Name": "TodoTable", + "ServiceRoleArn": { + "Fn::GetAtt": [ + "TodoIAMRole2DA8E66E", + "Arn" + ] + }, + "Type": "AMAZON_DYNAMODB" + }, + "DependsOn": [ + "TodoIAMRole2DA8E66E" + ] + }, + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "QuerygetTodopostAuth0Function", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a07a05bd2c51ef4301689c4b8ad017df158d0d180155b71f76fa4feafbd01583.vtl" + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "QueryGetTodoDataResolverFnQueryGetTodoDataResolverFnAppSyncFunctionE2B57DAD": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "QueryGetTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/08f4d557693d96c1a4efba0f9dc91330e4b19772fd5477c156468843e3d9cb5e.vtl" + }, + "ResponseMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4c6a2d29f01c6091bd1d9afe16e5849d456c96f17c3b215938c8067399532719.vtl" + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "GetTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "FieldName": "getTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerygetTodopostAuth0FunctionQuerygetTodopostAuth0FunctionAppSyncFunction6BE14593", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "QueryGetTodoDataResolverFnQueryGetTodoDataResolverFnAppSyncFunctionE2B57DAD", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Query\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"getTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] + }, + "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Query" + } + }, + "QuerylistTodospostAuth0FunctionQuerylistTodospostAuth0FunctionAppSyncFunction154D8577": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "QuerylistTodospostAuth0Function", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a07a05bd2c51ef4301689c4b8ad017df158d0d180155b71f76fa4feafbd01583.vtl" + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "QueryListTodosDataResolverFnQueryListTodosDataResolverFnAppSyncFunctionF825FE47": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "QueryListTodosDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/3665466abf40cc747bff935f1cf2f49edd920e2cd12d45d502d3857488b3ff3e.vtl" + }, + "ResponseMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/cc01911d0269d4080ea57505dc445dfc315ef7ad85d3d9d4ea1357858bff451d.vtl" + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "ListTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "FieldName": "listTodos", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "QuerylistTodospostAuth0FunctionQuerylistTodospostAuth0FunctionAppSyncFunction154D8577", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "QueryListTodosDataResolverFnQueryListTodosDataResolverFnAppSyncFunctionF825FE47", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Query\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"listTodos\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] + }, + "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Query" + } + }, + "MutationcreateTodoinit0FunctionMutationcreateTodoinit0FunctionAppSyncFunction54DE5B8B": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationcreateTodoinit0Function", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/01dd50f40481ed4d3b0fb1a5f22dbe631b252847144e59c565ad3874813dc77c.vtl" + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "MutationcreateTodopostAuth0FunctionMutationcreateTodopostAuth0FunctionAppSyncFunctionED59EB9F": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationcreateTodopostAuth0Function", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a07a05bd2c51ef4301689c4b8ad017df158d0d180155b71f76fa4feafbd01583.vtl" + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "MutationCreateTodoDataResolverFnMutationCreateTodoDataResolverFnAppSyncFunction900EC5CF": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationCreateTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/2bf64327ca5682da4be84d0d16440204e25abc3a221195b41f2d21dfa432e5ab.vtl" + }, + "ResponseMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f4a52b72209a9dfa197b5e7367a5c378c5bb86de6e29ddd9e48b49a3fe54b249.vtl" + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "CreateTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "FieldName": "createTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "MutationcreateTodoinit0FunctionMutationcreateTodoinit0FunctionAppSyncFunction54DE5B8B", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "MutationcreateTodopostAuth0FunctionMutationcreateTodopostAuth0FunctionAppSyncFunctionED59EB9F", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "MutationCreateTodoDataResolverFnMutationCreateTodoDataResolverFnAppSyncFunction900EC5CF", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Mutation\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"createTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] + }, + "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Mutation" + } + }, + "MutationupdateTodoinit0FunctionMutationupdateTodoinit0FunctionAppSyncFunction1B95BB19": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationupdateTodoinit0Function", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/06db846fd14e6fc371f22b12b5545ba8e2dbfeda85d8c8d586c71c282166657b.vtl" + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "MutationupdateTodopostAuth0FunctionMutationupdateTodopostAuth0FunctionAppSyncFunction50C507D7": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationupdateTodopostAuth0Function", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a07a05bd2c51ef4301689c4b8ad017df158d0d180155b71f76fa4feafbd01583.vtl" + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "MutationUpdateTodoDataResolverFnMutationUpdateTodoDataResolverFnAppSyncFunctionBC238C49": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationUpdateTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/474bf0776ec2164a13191d1a0a9e057154931e4918fea5086f49850d02a5371b.vtl" + }, + "ResponseMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f4a52b72209a9dfa197b5e7367a5c378c5bb86de6e29ddd9e48b49a3fe54b249.vtl" + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "UpdateTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "FieldName": "updateTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "MutationupdateTodoinit0FunctionMutationupdateTodoinit0FunctionAppSyncFunction1B95BB19", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "MutationupdateTodopostAuth0FunctionMutationupdateTodopostAuth0FunctionAppSyncFunction50C507D7", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "MutationUpdateTodoDataResolverFnMutationUpdateTodoDataResolverFnAppSyncFunctionBC238C49", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Mutation\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"updateTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] + }, + "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Mutation" + } + }, + "MutationdeleteTodopostAuth0FunctionMutationdeleteTodopostAuth0FunctionAppSyncFunction483271A2": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationdeleteTodopostAuth0Function", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a07a05bd2c51ef4301689c4b8ad017df158d0d180155b71f76fa4feafbd01583.vtl" + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "MutationDeleteTodoDataResolverFnMutationDeleteTodoDataResolverFnAppSyncFunction3879153F": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Fn::GetAtt": [ + "TodoDataSource", + "Name" + ] + }, + "FunctionVersion": "2018-05-29", + "Name": "MutationDeleteTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/4f7907d1209a2c9953a0c053df402c634e359546d70c7cc5c2e8e21ea734880f.vtl" + }, + "ResponseMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/f4a52b72209a9dfa197b5e7367a5c378c5bb86de6e29ddd9e48b49a3fe54b249.vtl" + } + }, + "DependsOn": [ + "TodoDataSource" + ] + }, + "DeleteTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "FieldName": "deleteTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "MutationdeleteTodopostAuth0FunctionMutationdeleteTodopostAuth0FunctionAppSyncFunction483271A2", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "MutationDeleteTodoDataResolverFnMutationDeleteTodoDataResolverFnAppSyncFunction3879153F", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Mutation\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"deleteTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"AMAZON_DYNAMODB\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", + { + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] + }, + "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Mutation" + } + }, + "SubscriptiononCreateTodopostAuth0FunctionSubscriptiononCreateTodopostAuth0FunctionAppSyncFunction18E34C4E": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "SubscriptiononCreateTodopostAuth0Function", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a07a05bd2c51ef4301689c4b8ad017df158d0d180155b71f76fa4feafbd01583.vtl" + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "SubscriptionOnCreateTodoDataResolverFnSubscriptionOnCreateTodoDataResolverFnAppSyncFunction462A70C9": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "SubscriptionOnCreateTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fe3c43ada4b9d681a5e2312663ef7a73386424d73b73e51f8e2e9d4b50f7c502.vtl" + }, + "ResponseMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e0cff47fb007f0bbf2a4e43ca256d6aa7ec109821769fd79fa7c5e83f0e7f9fc.vtl" + } + } + }, + "SubscriptiononCreateTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "FieldName": "onCreateTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "SubscriptiononCreateTodopostAuth0FunctionSubscriptiononCreateTodopostAuth0FunctionAppSyncFunction18E34C4E", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "SubscriptionOnCreateTodoDataResolverFnSubscriptionOnCreateTodoDataResolverFnAppSyncFunction462A70C9", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Subscription\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"onCreateTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"NONE\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Subscription" + } + }, + "SubscriptiononUpdateTodopostAuth0FunctionSubscriptiononUpdateTodopostAuth0FunctionAppSyncFunction04445BC7": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "SubscriptiononUpdateTodopostAuth0Function", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a07a05bd2c51ef4301689c4b8ad017df158d0d180155b71f76fa4feafbd01583.vtl" + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "SubscriptionOnUpdateTodoDataResolverFnSubscriptionOnUpdateTodoDataResolverFnAppSyncFunction523DF0E4": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "SubscriptionOnUpdateTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fe3c43ada4b9d681a5e2312663ef7a73386424d73b73e51f8e2e9d4b50f7c502.vtl" + }, + "ResponseMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e0cff47fb007f0bbf2a4e43ca256d6aa7ec109821769fd79fa7c5e83f0e7f9fc.vtl" + } + } + }, + "SubscriptiononUpdateTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "FieldName": "onUpdateTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "SubscriptiononUpdateTodopostAuth0FunctionSubscriptiononUpdateTodopostAuth0FunctionAppSyncFunction04445BC7", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "SubscriptionOnUpdateTodoDataResolverFnSubscriptionOnUpdateTodoDataResolverFnAppSyncFunction523DF0E4", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Subscription\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"onUpdateTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"NONE\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Subscription" + } + }, + "SubscriptiononDeleteTodopostAuth0FunctionSubscriptiononDeleteTodopostAuth0FunctionAppSyncFunctionE131CBE7": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "SubscriptiononDeleteTodopostAuth0Function", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/a07a05bd2c51ef4301689c4b8ad017df158d0d180155b71f76fa4feafbd01583.vtl" + }, + "ResponseMappingTemplate": "$util.toJson({})" + } + }, + "SubscriptionOnDeleteTodoDataResolverFnSubscriptionOnDeleteTodoDataResolverFnAppSyncFunction3E641E8C": { + "Type": "AWS::AppSync::FunctionConfiguration", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "DataSourceName": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPINONEDS1C56C895Name" + }, + "FunctionVersion": "2018-05-29", + "Name": "SubscriptionOnDeleteTodoDataResolverFn", + "RequestMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/fe3c43ada4b9d681a5e2312663ef7a73386424d73b73e51f8e2e9d4b50f7c502.vtl" + }, + "ResponseMappingTemplateS3Location": { + "Fn::Sub": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/e0cff47fb007f0bbf2a4e43ca256d6aa7ec109821769fd79fa7c5e83f0e7f9fc.vtl" + } + } + }, + "SubscriptiononDeleteTodoResolver": { + "Type": "AWS::AppSync::Resolver", + "Properties": { + "ApiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "FieldName": "onDeleteTodo", + "Kind": "PIPELINE", + "PipelineConfig": { + "Functions": [ + { + "Fn::GetAtt": [ + "SubscriptiononDeleteTodopostAuth0FunctionSubscriptiononDeleteTodopostAuth0FunctionAppSyncFunctionE131CBE7", + "FunctionId" + ] + }, + { + "Fn::GetAtt": [ + "SubscriptionOnDeleteTodoDataResolverFnSubscriptionOnDeleteTodoDataResolverFnAppSyncFunction3E641E8C", + "FunctionId" + ] + } + ] + }, + "RequestMappingTemplate": { + "Fn::Join": [ + "", + [ + "$util.qr($ctx.stash.put(\"typeName\", \"Subscription\"))\n$util.qr($ctx.stash.put(\"fieldName\", \"onDeleteTodo\"))\n$util.qr($ctx.stash.put(\"conditions\", []))\n$util.qr($ctx.stash.put(\"metadata\", {}))\n$util.qr($ctx.stash.metadata.put(\"dataSourceType\", \"NONE\"))\n$util.qr($ctx.stash.metadata.put(\"apiId\", \"", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" + ] + ] + }, + "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)", + "TypeName": "Subscription" + } + } + }, + "Outputs": { + "GetAttTodoTableStreamArn": { + "Description": "Your DynamoDB table StreamArn.", + "Value": { + "Fn::GetAtt": [ + "TodoTable", + "TableStreamArn" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:StreamArn" + ] + ] + } + } + }, + "GetAttTodoTableName": { + "Description": "Your DynamoDB table name.", + "Value": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:Name" + ] + ] + } + } + } + } +} \ No newline at end of file diff --git a/packages/integration-tests/test-projects/data-iterative-deploy/update-1/data/resource.ts b/packages/integration-tests/test-projects/data-iterative-deploy/update-1/data/resource.ts new file mode 100644 index 0000000000..566f2ef040 --- /dev/null +++ b/packages/integration-tests/test-projects/data-iterative-deploy/update-1/data/resource.ts @@ -0,0 +1,10 @@ +import { defineData } from '@aws-amplify/backend'; + +export const data = defineData({ + schema: /* GraphQL */ ` + type Todo @model { + field1: String! @index + field2: String! @index + } + `, +}); diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json index b1361e42d1..1e9d175753 100644 --- a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json @@ -533,7 +533,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/91617c68109f74d5a0741ff7c892b72894a57cf43dd20987912103b8acf036ac.json" + "/965afd4e7c1ec4149109c31f1fee3cf642fba411549b2faa97bf3ddb24b238cb.json" ] ] } diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json index f638b8c195..032c99de95 100644 --- a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json @@ -50,6 +50,41 @@ "Type": "NONE" } }, + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPI42A6FA33", + "ApiId" + ] + } + }, + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/35e06ca29c28793a345d0a1e4ed0a16bf7bad8a644c30c06a02b4218f7be6aa6.json" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, "amplifyDataTodoNestedStackTodoNestedStackResource551CEA56": { "Type": "AWS::CloudFormation::Stack", "Properties": { @@ -69,6 +104,12 @@ "DynamoDBEnableServerSideEncryption": { "Ref": "DynamoDBEnableServerSideEncryption" }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Fn::GetAtt": [ + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833", + "Outputs.amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn" + ] + }, "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { "Fn::GetAtt": [ "amplifyDataGraphQLAPI42A6FA33", @@ -107,7 +148,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/2c220fc1a16731ea6fb5b1c408536d38d0e77a954587ac056e76af6c762dc94d.json" + "/4a79ad097bd6f9650cd9e1d0f0fedf6ae9a46465c9f718f30fbed3e2fc459709.json" ] ] } diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json new file mode 100644 index 0000000000..b342d0c674 --- /dev/null +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json @@ -0,0 +1,987 @@ +{ + "Resources": { + "CreateUpdateDeleteTablesPolicyB7B6ADB5": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:CreateTable", + "dynamodb:UpdateTable", + "dynamodb:DeleteTable", + "dynamodb:DescribeTable", + "dynamodb:DescribeContinuousBackups", + "dynamodb:DescribeTimeToLive", + "dynamodb:UpdateContinuousBackups", + "dynamodb:UpdateTimeToLive" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/*-${apiId}-${envName}", + { + "apiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "envName": "NONE" + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CreateUpdateDeleteTablesPolicyB7B6ADB5", + "Roles": [ + { + "Ref": "TableManagerOnEventHandlerServiceRoleD69E8A0C" + }, + { + "Ref": "TableManagerIsCompleteHandlerServiceRole73EE73E4" + } + ] + } + }, + "TableManagerOnEventHandlerServiceRoleD69E8A0C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerOnEventHandler8779E150": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C" + ] + }, + "TableManagerIsCompleteHandlerServiceRole73EE73E4": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerIsCompleteHandler63238667": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4" + ] + }, + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + } + ] + } + }, + "TableManagerCustomProviderframeworkonEvent1DFC2ECC": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onEvent (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + "WAITER_STATE_MACHINE_ARN": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + }, + "Handler": "framework.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + ] + }, + "TableManagerCustomProviderframeworkonEventLogRetention3E5C45E7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonEvent1DFC2ECC" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + } + ] + } + }, + "TableManagerCustomProviderframeworkisComplete2E51021B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - isComplete (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + ] + }, + "TableManagerCustomProviderframeworkisCompleteLogRetentionBED1D9F7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkisComplete2E51021B" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutC98D33BB": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onTimeout (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.onTimeout", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + ] + }, + "TableManagerCustomProviderframeworkonTimeoutLogRetention3A93F510": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutC98D33BB" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderwaiterstatemachineRole9616A97E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": { + "Fn::FindInMap": [ + "ServiceprincipalMap", + { + "Ref": "AWS::Region" + }, + "states" + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "Roles": [ + { + "Ref": "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + } + ] + } + }, + "TableManagerCustomProviderwaiterstatemachine46E6141A": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"framework-isComplete-task\",\"States\":{\"framework-isComplete-task\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"States.ALL\"],\"IntervalSeconds\":30,\"MaxAttempts\":240,\"BackoffRate\":1}],\"Catch\":[{\"ErrorEquals\":[\"States.ALL\"],\"Next\":\"framework-onTimeout-task\"}],\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + "\"},\"framework-onTimeout-task\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + "\"}}}" + ] + ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "TableManagerCustomProviderwaiterstatemachineRole9616A97E", + "Arn" + ] + } + }, + "DependsOn": [ + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + ] + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:PutRetentionPolicy", + "logs:DeleteRetentionPolicy" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "Roles": [ + { + "Ref": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Handler": "index.handler", + "Runtime": "nodejs18.x", + "Timeout": 900, + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "5bc602ecde93c947efe5899ae355f999986a1acbe610b1c0b9c468d738857555.zip" + }, + "Role": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", + "Arn" + ] + } + }, + "DependsOn": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + ] + } + }, + "Mappings": { + "ServiceprincipalMap": { + "af-south-1": { + "states": "states.af-south-1.amazonaws.com" + }, + "ap-east-1": { + "states": "states.ap-east-1.amazonaws.com" + }, + "ap-northeast-1": { + "states": "states.ap-northeast-1.amazonaws.com" + }, + "ap-northeast-2": { + "states": "states.ap-northeast-2.amazonaws.com" + }, + "ap-northeast-3": { + "states": "states.ap-northeast-3.amazonaws.com" + }, + "ap-south-1": { + "states": "states.ap-south-1.amazonaws.com" + }, + "ap-south-2": { + "states": "states.ap-south-2.amazonaws.com" + }, + "ap-southeast-1": { + "states": "states.ap-southeast-1.amazonaws.com" + }, + "ap-southeast-2": { + "states": "states.ap-southeast-2.amazonaws.com" + }, + "ap-southeast-3": { + "states": "states.ap-southeast-3.amazonaws.com" + }, + "ap-southeast-4": { + "states": "states.ap-southeast-4.amazonaws.com" + }, + "ca-central-1": { + "states": "states.ca-central-1.amazonaws.com" + }, + "cn-north-1": { + "states": "states.cn-north-1.amazonaws.com" + }, + "cn-northwest-1": { + "states": "states.cn-northwest-1.amazonaws.com" + }, + "eu-central-1": { + "states": "states.eu-central-1.amazonaws.com" + }, + "eu-central-2": { + "states": "states.eu-central-2.amazonaws.com" + }, + "eu-north-1": { + "states": "states.eu-north-1.amazonaws.com" + }, + "eu-south-1": { + "states": "states.eu-south-1.amazonaws.com" + }, + "eu-south-2": { + "states": "states.eu-south-2.amazonaws.com" + }, + "eu-west-1": { + "states": "states.eu-west-1.amazonaws.com" + }, + "eu-west-2": { + "states": "states.eu-west-2.amazonaws.com" + }, + "eu-west-3": { + "states": "states.eu-west-3.amazonaws.com" + }, + "il-central-1": { + "states": "states.il-central-1.amazonaws.com" + }, + "me-central-1": { + "states": "states.me-central-1.amazonaws.com" + }, + "me-south-1": { + "states": "states.me-south-1.amazonaws.com" + }, + "sa-east-1": { + "states": "states.sa-east-1.amazonaws.com" + }, + "us-east-1": { + "states": "states.us-east-1.amazonaws.com" + }, + "us-east-2": { + "states": "states.us-east-2.amazonaws.com" + }, + "us-gov-east-1": { + "states": "states.us-gov-east-1.amazonaws.com" + }, + "us-gov-west-1": { + "states": "states.us-gov-west-1.amazonaws.com" + }, + "us-iso-east-1": { + "states": "states.amazonaws.com" + }, + "us-iso-west-1": { + "states": "states.amazonaws.com" + }, + "us-isob-east-1": { + "states": "states.amazonaws.com" + }, + "us-west-1": { + "states": "states.us-west-1.amazonaws.com" + }, + "us-west-2": { + "states": "states.us-west-2.amazonaws.com" + } + } + }, + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Type": "String" + } + }, + "Outputs": { + "amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn": { + "Value": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEvent1DFC2ECC", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json index 724f93cb8d..3da94b2e7d 100644 --- a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-cjs/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json @@ -37,6 +37,9 @@ ], "Description": "Enable server side encryption powered by KMS." }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Type": "String" + }, "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { "Type": "String" }, @@ -90,42 +93,37 @@ } }, "Resources": { - "TodoTable585F1D6B": { - "Type": "AWS::DynamoDB::Table", + "TodoTable": { + "Type": "Custom::AmplifyDynamoDBTable", "Properties": { - "AttributeDefinitions": [ + "ServiceToken": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E" + }, + "tableName": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "attributeDefinitions": [ { - "AttributeName": "id", - "AttributeType": "S" + "attributeName": "id", + "attributeType": "S" } ], - "BillingMode": { - "Fn::If": [ - "ShouldUsePayPerRequestBilling", - "PAY_PER_REQUEST", - { - "Ref": "AWS::NoValue" - } - ] - }, - "KeySchema": [ + "keySchema": [ { - "AttributeName": "id", - "KeyType": "HASH" + "attributeName": "id", + "keyType": "HASH" } ], - "PointInTimeRecoverySpecification": { - "Fn::If": [ - "ShouldUsePointInTimeRecovery", - { - "PointInTimeRecoveryEnabled": true - }, - { - "Ref": "AWS::NoValue" - } - ] - }, - "ProvisionedThroughput": { + "provisionedThroughput": { "Fn::If": [ "ShouldUsePayPerRequestBilling", { @@ -141,8 +139,8 @@ } ] }, - "SSESpecification": { - "SSEEnabled": { + "sseSpecification": { + "sseEnabled": { "Fn::If": [ "ShouldUseServerSideEncryption", true, @@ -150,19 +148,29 @@ ] } }, - "StreamSpecification": { - "StreamViewType": "NEW_AND_OLD_IMAGES" + "streamSpecification": { + "streamViewType": "NEW_AND_OLD_IMAGES" }, - "TableName": { - "Fn::Join": [ - "", - [ - "Todo-", - { - "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" - }, - "-NONE" - ] + "allowDestructiveGraphqlSchemaUpdates": false, + "replaceTableUponGsiUpdate": false, + "pointInTimeRecoverySpecification": { + "Fn::If": [ + "ShouldUsePointInTimeRecovery", + { + "PointInTimeRecoveryEnabled": true + }, + { + "Ref": "AWS::NoValue" + } + ] + }, + "billingMode": { + "Fn::If": [ + "ShouldUsePayPerRequestBilling", + "PAY_PER_REQUEST", + { + "Ref": "AWS::NoValue" + } ] } }, @@ -222,8 +230,8 @@ "Resource": [ { "Fn::GetAtt": [ - "TodoTable585F1D6B", - "Arn" + "TodoTable", + "TableArn" ] }, { @@ -322,7 +330,30 @@ "Ref": "AWS::Region" }, "TableName": { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] } }, "Name": "TodoTable", @@ -414,7 +445,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -520,7 +574,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -649,7 +726,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -778,7 +878,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -884,7 +1007,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -1202,5 +1348,57 @@ "TypeName": "Subscription" } } + }, + "Outputs": { + "GetAttTodoTableStreamArn": { + "Description": "Your DynamoDB table StreamArn.", + "Value": { + "Fn::GetAtt": [ + "TodoTable", + "TableStreamArn" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:StreamArn" + ] + ] + } + } + }, + "GetAttTodoTableName": { + "Description": "Your DynamoDB table name.", + "Value": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:Name" + ] + ] + } + } + } } } \ No newline at end of file diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json index b1361e42d1..1e9d175753 100644 --- a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json @@ -533,7 +533,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/91617c68109f74d5a0741ff7c892b72894a57cf43dd20987912103b8acf036ac.json" + "/965afd4e7c1ec4149109c31f1fee3cf642fba411549b2faa97bf3ddb24b238cb.json" ] ] } diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json index f638b8c195..032c99de95 100644 --- a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json @@ -50,6 +50,41 @@ "Type": "NONE" } }, + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPI42A6FA33", + "ApiId" + ] + } + }, + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/35e06ca29c28793a345d0a1e4ed0a16bf7bad8a644c30c06a02b4218f7be6aa6.json" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, "amplifyDataTodoNestedStackTodoNestedStackResource551CEA56": { "Type": "AWS::CloudFormation::Stack", "Properties": { @@ -69,6 +104,12 @@ "DynamoDBEnableServerSideEncryption": { "Ref": "DynamoDBEnableServerSideEncryption" }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Fn::GetAtt": [ + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833", + "Outputs.amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn" + ] + }, "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { "Fn::GetAtt": [ "amplifyDataGraphQLAPI42A6FA33", @@ -107,7 +148,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/2c220fc1a16731ea6fb5b1c408536d38d0e77a954587ac056e76af6c762dc94d.json" + "/4a79ad097bd6f9650cd9e1d0f0fedf6ae9a46465c9f718f30fbed3e2fc459709.json" ] ] } diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json new file mode 100644 index 0000000000..b342d0c674 --- /dev/null +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json @@ -0,0 +1,987 @@ +{ + "Resources": { + "CreateUpdateDeleteTablesPolicyB7B6ADB5": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:CreateTable", + "dynamodb:UpdateTable", + "dynamodb:DeleteTable", + "dynamodb:DescribeTable", + "dynamodb:DescribeContinuousBackups", + "dynamodb:DescribeTimeToLive", + "dynamodb:UpdateContinuousBackups", + "dynamodb:UpdateTimeToLive" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/*-${apiId}-${envName}", + { + "apiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "envName": "NONE" + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CreateUpdateDeleteTablesPolicyB7B6ADB5", + "Roles": [ + { + "Ref": "TableManagerOnEventHandlerServiceRoleD69E8A0C" + }, + { + "Ref": "TableManagerIsCompleteHandlerServiceRole73EE73E4" + } + ] + } + }, + "TableManagerOnEventHandlerServiceRoleD69E8A0C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerOnEventHandler8779E150": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C" + ] + }, + "TableManagerIsCompleteHandlerServiceRole73EE73E4": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerIsCompleteHandler63238667": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4" + ] + }, + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + } + ] + } + }, + "TableManagerCustomProviderframeworkonEvent1DFC2ECC": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onEvent (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + "WAITER_STATE_MACHINE_ARN": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + }, + "Handler": "framework.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + ] + }, + "TableManagerCustomProviderframeworkonEventLogRetention3E5C45E7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonEvent1DFC2ECC" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + } + ] + } + }, + "TableManagerCustomProviderframeworkisComplete2E51021B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - isComplete (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + ] + }, + "TableManagerCustomProviderframeworkisCompleteLogRetentionBED1D9F7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkisComplete2E51021B" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutC98D33BB": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onTimeout (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.onTimeout", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + ] + }, + "TableManagerCustomProviderframeworkonTimeoutLogRetention3A93F510": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutC98D33BB" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderwaiterstatemachineRole9616A97E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": { + "Fn::FindInMap": [ + "ServiceprincipalMap", + { + "Ref": "AWS::Region" + }, + "states" + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "Roles": [ + { + "Ref": "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + } + ] + } + }, + "TableManagerCustomProviderwaiterstatemachine46E6141A": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"framework-isComplete-task\",\"States\":{\"framework-isComplete-task\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"States.ALL\"],\"IntervalSeconds\":30,\"MaxAttempts\":240,\"BackoffRate\":1}],\"Catch\":[{\"ErrorEquals\":[\"States.ALL\"],\"Next\":\"framework-onTimeout-task\"}],\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + "\"},\"framework-onTimeout-task\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + "\"}}}" + ] + ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "TableManagerCustomProviderwaiterstatemachineRole9616A97E", + "Arn" + ] + } + }, + "DependsOn": [ + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + ] + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:PutRetentionPolicy", + "logs:DeleteRetentionPolicy" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "Roles": [ + { + "Ref": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Handler": "index.handler", + "Runtime": "nodejs18.x", + "Timeout": 900, + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "5bc602ecde93c947efe5899ae355f999986a1acbe610b1c0b9c468d738857555.zip" + }, + "Role": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", + "Arn" + ] + } + }, + "DependsOn": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + ] + } + }, + "Mappings": { + "ServiceprincipalMap": { + "af-south-1": { + "states": "states.af-south-1.amazonaws.com" + }, + "ap-east-1": { + "states": "states.ap-east-1.amazonaws.com" + }, + "ap-northeast-1": { + "states": "states.ap-northeast-1.amazonaws.com" + }, + "ap-northeast-2": { + "states": "states.ap-northeast-2.amazonaws.com" + }, + "ap-northeast-3": { + "states": "states.ap-northeast-3.amazonaws.com" + }, + "ap-south-1": { + "states": "states.ap-south-1.amazonaws.com" + }, + "ap-south-2": { + "states": "states.ap-south-2.amazonaws.com" + }, + "ap-southeast-1": { + "states": "states.ap-southeast-1.amazonaws.com" + }, + "ap-southeast-2": { + "states": "states.ap-southeast-2.amazonaws.com" + }, + "ap-southeast-3": { + "states": "states.ap-southeast-3.amazonaws.com" + }, + "ap-southeast-4": { + "states": "states.ap-southeast-4.amazonaws.com" + }, + "ca-central-1": { + "states": "states.ca-central-1.amazonaws.com" + }, + "cn-north-1": { + "states": "states.cn-north-1.amazonaws.com" + }, + "cn-northwest-1": { + "states": "states.cn-northwest-1.amazonaws.com" + }, + "eu-central-1": { + "states": "states.eu-central-1.amazonaws.com" + }, + "eu-central-2": { + "states": "states.eu-central-2.amazonaws.com" + }, + "eu-north-1": { + "states": "states.eu-north-1.amazonaws.com" + }, + "eu-south-1": { + "states": "states.eu-south-1.amazonaws.com" + }, + "eu-south-2": { + "states": "states.eu-south-2.amazonaws.com" + }, + "eu-west-1": { + "states": "states.eu-west-1.amazonaws.com" + }, + "eu-west-2": { + "states": "states.eu-west-2.amazonaws.com" + }, + "eu-west-3": { + "states": "states.eu-west-3.amazonaws.com" + }, + "il-central-1": { + "states": "states.il-central-1.amazonaws.com" + }, + "me-central-1": { + "states": "states.me-central-1.amazonaws.com" + }, + "me-south-1": { + "states": "states.me-south-1.amazonaws.com" + }, + "sa-east-1": { + "states": "states.sa-east-1.amazonaws.com" + }, + "us-east-1": { + "states": "states.us-east-1.amazonaws.com" + }, + "us-east-2": { + "states": "states.us-east-2.amazonaws.com" + }, + "us-gov-east-1": { + "states": "states.us-gov-east-1.amazonaws.com" + }, + "us-gov-west-1": { + "states": "states.us-gov-west-1.amazonaws.com" + }, + "us-iso-east-1": { + "states": "states.amazonaws.com" + }, + "us-iso-west-1": { + "states": "states.amazonaws.com" + }, + "us-isob-east-1": { + "states": "states.amazonaws.com" + }, + "us-west-1": { + "states": "states.us-west-1.amazonaws.com" + }, + "us-west-2": { + "states": "states.us-west-2.amazonaws.com" + } + } + }, + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Type": "String" + } + }, + "Outputs": { + "amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn": { + "Value": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEvent1DFC2ECC", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json index 724f93cb8d..3da94b2e7d 100644 --- a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-js/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json @@ -37,6 +37,9 @@ ], "Description": "Enable server side encryption powered by KMS." }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Type": "String" + }, "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { "Type": "String" }, @@ -90,42 +93,37 @@ } }, "Resources": { - "TodoTable585F1D6B": { - "Type": "AWS::DynamoDB::Table", + "TodoTable": { + "Type": "Custom::AmplifyDynamoDBTable", "Properties": { - "AttributeDefinitions": [ + "ServiceToken": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E" + }, + "tableName": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "attributeDefinitions": [ { - "AttributeName": "id", - "AttributeType": "S" + "attributeName": "id", + "attributeType": "S" } ], - "BillingMode": { - "Fn::If": [ - "ShouldUsePayPerRequestBilling", - "PAY_PER_REQUEST", - { - "Ref": "AWS::NoValue" - } - ] - }, - "KeySchema": [ + "keySchema": [ { - "AttributeName": "id", - "KeyType": "HASH" + "attributeName": "id", + "keyType": "HASH" } ], - "PointInTimeRecoverySpecification": { - "Fn::If": [ - "ShouldUsePointInTimeRecovery", - { - "PointInTimeRecoveryEnabled": true - }, - { - "Ref": "AWS::NoValue" - } - ] - }, - "ProvisionedThroughput": { + "provisionedThroughput": { "Fn::If": [ "ShouldUsePayPerRequestBilling", { @@ -141,8 +139,8 @@ } ] }, - "SSESpecification": { - "SSEEnabled": { + "sseSpecification": { + "sseEnabled": { "Fn::If": [ "ShouldUseServerSideEncryption", true, @@ -150,19 +148,29 @@ ] } }, - "StreamSpecification": { - "StreamViewType": "NEW_AND_OLD_IMAGES" + "streamSpecification": { + "streamViewType": "NEW_AND_OLD_IMAGES" }, - "TableName": { - "Fn::Join": [ - "", - [ - "Todo-", - { - "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" - }, - "-NONE" - ] + "allowDestructiveGraphqlSchemaUpdates": false, + "replaceTableUponGsiUpdate": false, + "pointInTimeRecoverySpecification": { + "Fn::If": [ + "ShouldUsePointInTimeRecovery", + { + "PointInTimeRecoveryEnabled": true + }, + { + "Ref": "AWS::NoValue" + } + ] + }, + "billingMode": { + "Fn::If": [ + "ShouldUsePayPerRequestBilling", + "PAY_PER_REQUEST", + { + "Ref": "AWS::NoValue" + } ] } }, @@ -222,8 +230,8 @@ "Resource": [ { "Fn::GetAtt": [ - "TodoTable585F1D6B", - "Arn" + "TodoTable", + "TableArn" ] }, { @@ -322,7 +330,30 @@ "Ref": "AWS::Region" }, "TableName": { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] } }, "Name": "TodoTable", @@ -414,7 +445,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -520,7 +574,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -649,7 +726,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -778,7 +878,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -884,7 +1007,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -1202,5 +1348,57 @@ "TypeName": "Subscription" } } + }, + "Outputs": { + "GetAttTodoTableStreamArn": { + "Description": "Your DynamoDB table StreamArn.", + "Value": { + "Fn::GetAtt": [ + "TodoTable", + "TableStreamArn" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:StreamArn" + ] + ] + } + } + }, + "GetAttTodoTableName": { + "Description": "Your DynamoDB table name.", + "Value": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:Name" + ] + ] + } + } + } } } \ No newline at end of file diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json index 9b4a210090..5a00fa01bb 100644 --- a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json @@ -533,7 +533,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/65ece01c1646040857ae277f2c1473324933c31f671dc69fbc5cf63d799470e7.json" + "/e3b7408ab4bbaeadd73eedb90b52f405e5c1650dd1e8db0de58244d0d08b55ee.json" ] ] } diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json index eaa4f38eb2..472c083205 100644 --- a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json @@ -50,6 +50,41 @@ "Type": "NONE" } }, + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPI42A6FA33", + "ApiId" + ] + } + }, + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/35e06ca29c28793a345d0a1e4ed0a16bf7bad8a644c30c06a02b4218f7be6aa6.json" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, "amplifyDataTodoNestedStackTodoNestedStackResource551CEA56": { "Type": "AWS::CloudFormation::Stack", "Properties": { @@ -69,6 +104,12 @@ "DynamoDBEnableServerSideEncryption": { "Ref": "DynamoDBEnableServerSideEncryption" }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Fn::GetAtt": [ + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833", + "Outputs.amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn" + ] + }, "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { "Fn::GetAtt": [ "amplifyDataGraphQLAPI42A6FA33", @@ -107,7 +148,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/2c220fc1a16731ea6fb5b1c408536d38d0e77a954587ac056e76af6c762dc94d.json" + "/4a79ad097bd6f9650cd9e1d0f0fedf6ae9a46465c9f718f30fbed3e2fc459709.json" ] ] } diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json new file mode 100644 index 0000000000..b342d0c674 --- /dev/null +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json @@ -0,0 +1,987 @@ +{ + "Resources": { + "CreateUpdateDeleteTablesPolicyB7B6ADB5": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:CreateTable", + "dynamodb:UpdateTable", + "dynamodb:DeleteTable", + "dynamodb:DescribeTable", + "dynamodb:DescribeContinuousBackups", + "dynamodb:DescribeTimeToLive", + "dynamodb:UpdateContinuousBackups", + "dynamodb:UpdateTimeToLive" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/*-${apiId}-${envName}", + { + "apiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "envName": "NONE" + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CreateUpdateDeleteTablesPolicyB7B6ADB5", + "Roles": [ + { + "Ref": "TableManagerOnEventHandlerServiceRoleD69E8A0C" + }, + { + "Ref": "TableManagerIsCompleteHandlerServiceRole73EE73E4" + } + ] + } + }, + "TableManagerOnEventHandlerServiceRoleD69E8A0C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerOnEventHandler8779E150": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C" + ] + }, + "TableManagerIsCompleteHandlerServiceRole73EE73E4": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerIsCompleteHandler63238667": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4" + ] + }, + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + } + ] + } + }, + "TableManagerCustomProviderframeworkonEvent1DFC2ECC": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onEvent (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + "WAITER_STATE_MACHINE_ARN": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + }, + "Handler": "framework.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + ] + }, + "TableManagerCustomProviderframeworkonEventLogRetention3E5C45E7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonEvent1DFC2ECC" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + } + ] + } + }, + "TableManagerCustomProviderframeworkisComplete2E51021B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - isComplete (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + ] + }, + "TableManagerCustomProviderframeworkisCompleteLogRetentionBED1D9F7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkisComplete2E51021B" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutC98D33BB": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onTimeout (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.onTimeout", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + ] + }, + "TableManagerCustomProviderframeworkonTimeoutLogRetention3A93F510": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutC98D33BB" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderwaiterstatemachineRole9616A97E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": { + "Fn::FindInMap": [ + "ServiceprincipalMap", + { + "Ref": "AWS::Region" + }, + "states" + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "Roles": [ + { + "Ref": "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + } + ] + } + }, + "TableManagerCustomProviderwaiterstatemachine46E6141A": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"framework-isComplete-task\",\"States\":{\"framework-isComplete-task\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"States.ALL\"],\"IntervalSeconds\":30,\"MaxAttempts\":240,\"BackoffRate\":1}],\"Catch\":[{\"ErrorEquals\":[\"States.ALL\"],\"Next\":\"framework-onTimeout-task\"}],\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + "\"},\"framework-onTimeout-task\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + "\"}}}" + ] + ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "TableManagerCustomProviderwaiterstatemachineRole9616A97E", + "Arn" + ] + } + }, + "DependsOn": [ + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + ] + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:PutRetentionPolicy", + "logs:DeleteRetentionPolicy" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "Roles": [ + { + "Ref": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Handler": "index.handler", + "Runtime": "nodejs18.x", + "Timeout": 900, + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "5bc602ecde93c947efe5899ae355f999986a1acbe610b1c0b9c468d738857555.zip" + }, + "Role": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", + "Arn" + ] + } + }, + "DependsOn": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + ] + } + }, + "Mappings": { + "ServiceprincipalMap": { + "af-south-1": { + "states": "states.af-south-1.amazonaws.com" + }, + "ap-east-1": { + "states": "states.ap-east-1.amazonaws.com" + }, + "ap-northeast-1": { + "states": "states.ap-northeast-1.amazonaws.com" + }, + "ap-northeast-2": { + "states": "states.ap-northeast-2.amazonaws.com" + }, + "ap-northeast-3": { + "states": "states.ap-northeast-3.amazonaws.com" + }, + "ap-south-1": { + "states": "states.ap-south-1.amazonaws.com" + }, + "ap-south-2": { + "states": "states.ap-south-2.amazonaws.com" + }, + "ap-southeast-1": { + "states": "states.ap-southeast-1.amazonaws.com" + }, + "ap-southeast-2": { + "states": "states.ap-southeast-2.amazonaws.com" + }, + "ap-southeast-3": { + "states": "states.ap-southeast-3.amazonaws.com" + }, + "ap-southeast-4": { + "states": "states.ap-southeast-4.amazonaws.com" + }, + "ca-central-1": { + "states": "states.ca-central-1.amazonaws.com" + }, + "cn-north-1": { + "states": "states.cn-north-1.amazonaws.com" + }, + "cn-northwest-1": { + "states": "states.cn-northwest-1.amazonaws.com" + }, + "eu-central-1": { + "states": "states.eu-central-1.amazonaws.com" + }, + "eu-central-2": { + "states": "states.eu-central-2.amazonaws.com" + }, + "eu-north-1": { + "states": "states.eu-north-1.amazonaws.com" + }, + "eu-south-1": { + "states": "states.eu-south-1.amazonaws.com" + }, + "eu-south-2": { + "states": "states.eu-south-2.amazonaws.com" + }, + "eu-west-1": { + "states": "states.eu-west-1.amazonaws.com" + }, + "eu-west-2": { + "states": "states.eu-west-2.amazonaws.com" + }, + "eu-west-3": { + "states": "states.eu-west-3.amazonaws.com" + }, + "il-central-1": { + "states": "states.il-central-1.amazonaws.com" + }, + "me-central-1": { + "states": "states.me-central-1.amazonaws.com" + }, + "me-south-1": { + "states": "states.me-south-1.amazonaws.com" + }, + "sa-east-1": { + "states": "states.sa-east-1.amazonaws.com" + }, + "us-east-1": { + "states": "states.us-east-1.amazonaws.com" + }, + "us-east-2": { + "states": "states.us-east-2.amazonaws.com" + }, + "us-gov-east-1": { + "states": "states.us-gov-east-1.amazonaws.com" + }, + "us-gov-west-1": { + "states": "states.us-gov-west-1.amazonaws.com" + }, + "us-iso-east-1": { + "states": "states.amazonaws.com" + }, + "us-iso-west-1": { + "states": "states.amazonaws.com" + }, + "us-isob-east-1": { + "states": "states.amazonaws.com" + }, + "us-west-1": { + "states": "states.us-west-1.amazonaws.com" + }, + "us-west-2": { + "states": "states.us-west-2.amazonaws.com" + } + } + }, + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Type": "String" + } + }, + "Outputs": { + "amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn": { + "Value": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEvent1DFC2ECC", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json index 724f93cb8d..3da94b2e7d 100644 --- a/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json +++ b/packages/integration-tests/test-projects/data-storage-auth-with-triggers-ts/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json @@ -37,6 +37,9 @@ ], "Description": "Enable server side encryption powered by KMS." }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Type": "String" + }, "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { "Type": "String" }, @@ -90,42 +93,37 @@ } }, "Resources": { - "TodoTable585F1D6B": { - "Type": "AWS::DynamoDB::Table", + "TodoTable": { + "Type": "Custom::AmplifyDynamoDBTable", "Properties": { - "AttributeDefinitions": [ + "ServiceToken": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E" + }, + "tableName": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "attributeDefinitions": [ { - "AttributeName": "id", - "AttributeType": "S" + "attributeName": "id", + "attributeType": "S" } ], - "BillingMode": { - "Fn::If": [ - "ShouldUsePayPerRequestBilling", - "PAY_PER_REQUEST", - { - "Ref": "AWS::NoValue" - } - ] - }, - "KeySchema": [ + "keySchema": [ { - "AttributeName": "id", - "KeyType": "HASH" + "attributeName": "id", + "keyType": "HASH" } ], - "PointInTimeRecoverySpecification": { - "Fn::If": [ - "ShouldUsePointInTimeRecovery", - { - "PointInTimeRecoveryEnabled": true - }, - { - "Ref": "AWS::NoValue" - } - ] - }, - "ProvisionedThroughput": { + "provisionedThroughput": { "Fn::If": [ "ShouldUsePayPerRequestBilling", { @@ -141,8 +139,8 @@ } ] }, - "SSESpecification": { - "SSEEnabled": { + "sseSpecification": { + "sseEnabled": { "Fn::If": [ "ShouldUseServerSideEncryption", true, @@ -150,19 +148,29 @@ ] } }, - "StreamSpecification": { - "StreamViewType": "NEW_AND_OLD_IMAGES" + "streamSpecification": { + "streamViewType": "NEW_AND_OLD_IMAGES" }, - "TableName": { - "Fn::Join": [ - "", - [ - "Todo-", - { - "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" - }, - "-NONE" - ] + "allowDestructiveGraphqlSchemaUpdates": false, + "replaceTableUponGsiUpdate": false, + "pointInTimeRecoverySpecification": { + "Fn::If": [ + "ShouldUsePointInTimeRecovery", + { + "PointInTimeRecoveryEnabled": true + }, + { + "Ref": "AWS::NoValue" + } + ] + }, + "billingMode": { + "Fn::If": [ + "ShouldUsePayPerRequestBilling", + "PAY_PER_REQUEST", + { + "Ref": "AWS::NoValue" + } ] } }, @@ -222,8 +230,8 @@ "Resource": [ { "Fn::GetAtt": [ - "TodoTable585F1D6B", - "Arn" + "TodoTable", + "TableArn" ] }, { @@ -322,7 +330,30 @@ "Ref": "AWS::Region" }, "TableName": { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] } }, "Name": "TodoTable", @@ -414,7 +445,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -520,7 +574,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -649,7 +726,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -778,7 +878,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -884,7 +1007,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"authRole\", \"arn:aws:sts::", { @@ -1202,5 +1348,57 @@ "TypeName": "Subscription" } } + }, + "Outputs": { + "GetAttTodoTableStreamArn": { + "Description": "Your DynamoDB table StreamArn.", + "Value": { + "Fn::GetAtt": [ + "TodoTable", + "TableStreamArn" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:StreamArn" + ] + ] + } + } + }, + "GetAttTodoTableName": { + "Description": "Your DynamoDB table name.", + "Value": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:Name" + ] + ] + } + } + } } } \ No newline at end of file diff --git a/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json b/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json index f7855b9e33..0053e8bfc9 100644 --- a/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json +++ b/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json @@ -318,7 +318,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/bfcc14bff757c5d4f0a464a8852ec51ea2cd694ffc32e815b3a77474c95627fe.json" + "/7d798d30e51cd1ea1950686bb965e0fb3839b11d9c5e2b659bdc17fb852fcc1a.json" ] ] } diff --git a/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json b/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json index dc212e17fe..d33af45af3 100644 --- a/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json +++ b/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json @@ -51,7 +51,7 @@ "ApiId" ] }, - "Expires": 1702671881 + "Expires": 1702675654 } }, "amplifyDataGraphQLAPINONEDS684BF699": { @@ -68,6 +68,41 @@ "Type": "NONE" } }, + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPI42A6FA33", + "ApiId" + ] + } + }, + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/35e06ca29c28793a345d0a1e4ed0a16bf7bad8a644c30c06a02b4218f7be6aa6.json" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, "amplifyDataTodoNestedStackTodoNestedStackResource551CEA56": { "Type": "AWS::CloudFormation::Stack", "Properties": { @@ -87,6 +122,12 @@ "DynamoDBEnableServerSideEncryption": { "Ref": "DynamoDBEnableServerSideEncryption" }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Fn::GetAtt": [ + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833", + "Outputs.amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn" + ] + }, "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { "Fn::GetAtt": [ "amplifyDataGraphQLAPI42A6FA33", @@ -116,7 +157,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/65902aeee9119f4103aaefb36ae5d93c0cf18bdfa10863d85db129134ca3052d.json" + "/580228053b6e026b7f9389b9ec80f5dd0ffe66538d18ae535134bd77335db21d.json" ] ] } diff --git a/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json b/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json new file mode 100644 index 0000000000..b342d0c674 --- /dev/null +++ b/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json @@ -0,0 +1,987 @@ +{ + "Resources": { + "CreateUpdateDeleteTablesPolicyB7B6ADB5": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:CreateTable", + "dynamodb:UpdateTable", + "dynamodb:DeleteTable", + "dynamodb:DescribeTable", + "dynamodb:DescribeContinuousBackups", + "dynamodb:DescribeTimeToLive", + "dynamodb:UpdateContinuousBackups", + "dynamodb:UpdateTimeToLive" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/*-${apiId}-${envName}", + { + "apiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "envName": "NONE" + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CreateUpdateDeleteTablesPolicyB7B6ADB5", + "Roles": [ + { + "Ref": "TableManagerOnEventHandlerServiceRoleD69E8A0C" + }, + { + "Ref": "TableManagerIsCompleteHandlerServiceRole73EE73E4" + } + ] + } + }, + "TableManagerOnEventHandlerServiceRoleD69E8A0C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerOnEventHandler8779E150": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C" + ] + }, + "TableManagerIsCompleteHandlerServiceRole73EE73E4": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerIsCompleteHandler63238667": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4" + ] + }, + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + } + ] + } + }, + "TableManagerCustomProviderframeworkonEvent1DFC2ECC": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onEvent (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + "WAITER_STATE_MACHINE_ARN": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + }, + "Handler": "framework.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + ] + }, + "TableManagerCustomProviderframeworkonEventLogRetention3E5C45E7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonEvent1DFC2ECC" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + } + ] + } + }, + "TableManagerCustomProviderframeworkisComplete2E51021B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - isComplete (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + ] + }, + "TableManagerCustomProviderframeworkisCompleteLogRetentionBED1D9F7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkisComplete2E51021B" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutC98D33BB": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onTimeout (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.onTimeout", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + ] + }, + "TableManagerCustomProviderframeworkonTimeoutLogRetention3A93F510": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutC98D33BB" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderwaiterstatemachineRole9616A97E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": { + "Fn::FindInMap": [ + "ServiceprincipalMap", + { + "Ref": "AWS::Region" + }, + "states" + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "Roles": [ + { + "Ref": "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + } + ] + } + }, + "TableManagerCustomProviderwaiterstatemachine46E6141A": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"framework-isComplete-task\",\"States\":{\"framework-isComplete-task\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"States.ALL\"],\"IntervalSeconds\":30,\"MaxAttempts\":240,\"BackoffRate\":1}],\"Catch\":[{\"ErrorEquals\":[\"States.ALL\"],\"Next\":\"framework-onTimeout-task\"}],\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + "\"},\"framework-onTimeout-task\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + "\"}}}" + ] + ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "TableManagerCustomProviderwaiterstatemachineRole9616A97E", + "Arn" + ] + } + }, + "DependsOn": [ + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + ] + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:PutRetentionPolicy", + "logs:DeleteRetentionPolicy" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "Roles": [ + { + "Ref": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Handler": "index.handler", + "Runtime": "nodejs18.x", + "Timeout": 900, + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "5bc602ecde93c947efe5899ae355f999986a1acbe610b1c0b9c468d738857555.zip" + }, + "Role": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", + "Arn" + ] + } + }, + "DependsOn": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + ] + } + }, + "Mappings": { + "ServiceprincipalMap": { + "af-south-1": { + "states": "states.af-south-1.amazonaws.com" + }, + "ap-east-1": { + "states": "states.ap-east-1.amazonaws.com" + }, + "ap-northeast-1": { + "states": "states.ap-northeast-1.amazonaws.com" + }, + "ap-northeast-2": { + "states": "states.ap-northeast-2.amazonaws.com" + }, + "ap-northeast-3": { + "states": "states.ap-northeast-3.amazonaws.com" + }, + "ap-south-1": { + "states": "states.ap-south-1.amazonaws.com" + }, + "ap-south-2": { + "states": "states.ap-south-2.amazonaws.com" + }, + "ap-southeast-1": { + "states": "states.ap-southeast-1.amazonaws.com" + }, + "ap-southeast-2": { + "states": "states.ap-southeast-2.amazonaws.com" + }, + "ap-southeast-3": { + "states": "states.ap-southeast-3.amazonaws.com" + }, + "ap-southeast-4": { + "states": "states.ap-southeast-4.amazonaws.com" + }, + "ca-central-1": { + "states": "states.ca-central-1.amazonaws.com" + }, + "cn-north-1": { + "states": "states.cn-north-1.amazonaws.com" + }, + "cn-northwest-1": { + "states": "states.cn-northwest-1.amazonaws.com" + }, + "eu-central-1": { + "states": "states.eu-central-1.amazonaws.com" + }, + "eu-central-2": { + "states": "states.eu-central-2.amazonaws.com" + }, + "eu-north-1": { + "states": "states.eu-north-1.amazonaws.com" + }, + "eu-south-1": { + "states": "states.eu-south-1.amazonaws.com" + }, + "eu-south-2": { + "states": "states.eu-south-2.amazonaws.com" + }, + "eu-west-1": { + "states": "states.eu-west-1.amazonaws.com" + }, + "eu-west-2": { + "states": "states.eu-west-2.amazonaws.com" + }, + "eu-west-3": { + "states": "states.eu-west-3.amazonaws.com" + }, + "il-central-1": { + "states": "states.il-central-1.amazonaws.com" + }, + "me-central-1": { + "states": "states.me-central-1.amazonaws.com" + }, + "me-south-1": { + "states": "states.me-south-1.amazonaws.com" + }, + "sa-east-1": { + "states": "states.sa-east-1.amazonaws.com" + }, + "us-east-1": { + "states": "states.us-east-1.amazonaws.com" + }, + "us-east-2": { + "states": "states.us-east-2.amazonaws.com" + }, + "us-gov-east-1": { + "states": "states.us-gov-east-1.amazonaws.com" + }, + "us-gov-west-1": { + "states": "states.us-gov-west-1.amazonaws.com" + }, + "us-iso-east-1": { + "states": "states.amazonaws.com" + }, + "us-iso-west-1": { + "states": "states.amazonaws.com" + }, + "us-isob-east-1": { + "states": "states.amazonaws.com" + }, + "us-west-1": { + "states": "states.us-west-1.amazonaws.com" + }, + "us-west-2": { + "states": "states.us-west-2.amazonaws.com" + } + } + }, + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Type": "String" + } + }, + "Outputs": { + "amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn": { + "Value": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEvent1DFC2ECC", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json b/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json index 6758daacf2..434dbe0fdb 100644 --- a/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json +++ b/packages/integration-tests/test-projects/standalone-data-auth-modes/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json @@ -37,6 +37,9 @@ ], "Description": "Enable server side encryption powered by KMS." }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Type": "String" + }, "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { "Type": "String" }, @@ -81,42 +84,37 @@ } }, "Resources": { - "TodoTable585F1D6B": { - "Type": "AWS::DynamoDB::Table", + "TodoTable": { + "Type": "Custom::AmplifyDynamoDBTable", "Properties": { - "AttributeDefinitions": [ + "ServiceToken": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E" + }, + "tableName": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "attributeDefinitions": [ { - "AttributeName": "id", - "AttributeType": "S" + "attributeName": "id", + "attributeType": "S" } ], - "BillingMode": { - "Fn::If": [ - "ShouldUsePayPerRequestBilling", - "PAY_PER_REQUEST", - { - "Ref": "AWS::NoValue" - } - ] - }, - "KeySchema": [ + "keySchema": [ { - "AttributeName": "id", - "KeyType": "HASH" + "attributeName": "id", + "keyType": "HASH" } ], - "PointInTimeRecoverySpecification": { - "Fn::If": [ - "ShouldUsePointInTimeRecovery", - { - "PointInTimeRecoveryEnabled": true - }, - { - "Ref": "AWS::NoValue" - } - ] - }, - "ProvisionedThroughput": { + "provisionedThroughput": { "Fn::If": [ "ShouldUsePayPerRequestBilling", { @@ -132,8 +130,8 @@ } ] }, - "SSESpecification": { - "SSEEnabled": { + "sseSpecification": { + "sseEnabled": { "Fn::If": [ "ShouldUseServerSideEncryption", true, @@ -141,19 +139,29 @@ ] } }, - "StreamSpecification": { - "StreamViewType": "NEW_AND_OLD_IMAGES" + "streamSpecification": { + "streamViewType": "NEW_AND_OLD_IMAGES" }, - "TableName": { - "Fn::Join": [ - "", - [ - "Todo-", - { - "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" - }, - "-NONE" - ] + "allowDestructiveGraphqlSchemaUpdates": false, + "replaceTableUponGsiUpdate": false, + "pointInTimeRecoverySpecification": { + "Fn::If": [ + "ShouldUsePointInTimeRecovery", + { + "PointInTimeRecoveryEnabled": true + }, + { + "Ref": "AWS::NoValue" + } + ] + }, + "billingMode": { + "Fn::If": [ + "ShouldUsePayPerRequestBilling", + "PAY_PER_REQUEST", + { + "Ref": "AWS::NoValue" + } ] } }, @@ -213,8 +221,8 @@ "Resource": [ { "Fn::GetAtt": [ - "TodoTable585F1D6B", - "Arn" + "TodoTable", + "TableArn" ] }, { @@ -313,7 +321,30 @@ "Ref": "AWS::Region" }, "TableName": { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] } }, "Name": "TodoTable", @@ -428,7 +459,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" ] @@ -537,7 +591,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" ] @@ -669,7 +746,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" ] @@ -809,7 +909,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" ] @@ -926,7 +1049,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" ] @@ -1286,5 +1432,57 @@ "TypeName": "Todo" } } + }, + "Outputs": { + "GetAttTodoTableStreamArn": { + "Description": "Your DynamoDB table StreamArn.", + "Value": { + "Fn::GetAtt": [ + "TodoTable", + "TableStreamArn" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:StreamArn" + ] + ] + } + } + }, + "GetAttTodoTableName": { + "Description": "Your DynamoDB table name.", + "Value": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:Name" + ] + ] + } + } + } } } \ No newline at end of file diff --git a/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json b/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json index b03c713e65..446d4462e9 100644 --- a/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json +++ b/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplify-testAppId-testBranchName-branch-7d6f6c854a.template.json @@ -306,7 +306,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/08a4b311feebe95c66f259eb5ffef79bcf5d8bf808b797366a6f3f874c87a4ed.json" + "/6c94930056400c88525870d33e7d10bfd8cad0fff07d5c93d5894566371e9231.json" ] ] } diff --git a/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json b/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json index a70e9b22a1..92c49f992e 100644 --- a/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json +++ b/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataE67321C2.nested.template.json @@ -31,7 +31,7 @@ "ApiId" ] }, - "Expires": 1700684682 + "Expires": 1700688456 } }, "amplifyDataGraphQLAPINONEDS684BF699": { @@ -48,6 +48,41 @@ "Type": "NONE" } }, + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833": { + "Type": "AWS::CloudFormation::Stack", + "Properties": { + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Fn::GetAtt": [ + "amplifyDataGraphQLAPI42A6FA33", + "ApiId" + ] + } + }, + "TemplateURL": { + "Fn::Join": [ + "", + [ + "https://s3.", + { + "Ref": "AWS::Region" + }, + ".", + { + "Ref": "AWS::URLSuffix" + }, + "/", + { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "/35e06ca29c28793a345d0a1e4ed0a16bf7bad8a644c30c06a02b4218f7be6aa6.json" + ] + ] + } + }, + "UpdateReplacePolicy": "Delete", + "DeletionPolicy": "Delete" + }, "amplifyDataTodoNestedStackTodoNestedStackResource551CEA56": { "Type": "AWS::CloudFormation::Stack", "Properties": { @@ -67,6 +102,12 @@ "DynamoDBEnableServerSideEncryption": { "Ref": "DynamoDBEnableServerSideEncryption" }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Fn::GetAtt": [ + "amplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource86290833", + "Outputs.amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn" + ] + }, "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { "Fn::GetAtt": [ "amplifyDataGraphQLAPI42A6FA33", @@ -96,7 +137,7 @@ { "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" }, - "/8ac627f2019ef48f92dde30b69f86e762587a898103afb781d4552bee5d9fab4.json" + "/b2592dc0925350164d369b9756628f4e37c379d41cabf3012d22754ae7b343f8.json" ] ] } diff --git a/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json b/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json new file mode 100644 index 0000000000..b342d0c674 --- /dev/null +++ b/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerA0EBF206.nested.template.json @@ -0,0 +1,987 @@ +{ + "Resources": { + "CreateUpdateDeleteTablesPolicyB7B6ADB5": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "dynamodb:CreateTable", + "dynamodb:UpdateTable", + "dynamodb:DeleteTable", + "dynamodb:DescribeTable", + "dynamodb:DescribeContinuousBackups", + "dynamodb:DescribeTimeToLive", + "dynamodb:UpdateContinuousBackups", + "dynamodb:UpdateTimeToLive" + ], + "Effect": "Allow", + "Resource": { + "Fn::Sub": [ + "arn:aws:dynamodb:${AWS::Region}:${AWS::AccountId}:table/*-${apiId}-${envName}", + { + "apiId": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "envName": "NONE" + } + ] + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "CreateUpdateDeleteTablesPolicyB7B6ADB5", + "Roles": [ + { + "Ref": "TableManagerOnEventHandlerServiceRoleD69E8A0C" + }, + { + "Ref": "TableManagerIsCompleteHandlerServiceRole73EE73E4" + } + ] + } + }, + "TableManagerOnEventHandlerServiceRoleD69E8A0C": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerOnEventHandler8779E150": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerOnEventHandlerServiceRoleD69E8A0C" + ] + }, + "TableManagerIsCompleteHandlerServiceRole73EE73E4": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerIsCompleteHandler63238667": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "35f0ff01a162da0adea484fa653e860e0b7c072bd5ab30402714eeff56ba0b45.zip" + }, + "Handler": "amplify-table-manager-handler.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 840 + }, + "DependsOn": [ + "TableManagerIsCompleteHandlerServiceRole73EE73E4" + ] + }, + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "states:StartExecution", + "Effect": "Allow", + "Resource": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + } + ] + } + }, + "TableManagerCustomProviderframeworkonEvent1DFC2ECC": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onEvent (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + "WAITER_STATE_MACHINE_ARN": { + "Ref": "TableManagerCustomProviderwaiterstatemachine46E6141A" + } + } + }, + "Handler": "framework.onEvent", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonEventServiceRoleDefaultPolicy679A5FD0", + "TableManagerCustomProviderframeworkonEventServiceRole9A1F0230" + ] + }, + "TableManagerCustomProviderframeworkonEventLogRetention3E5C45E7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonEvent1DFC2ECC" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + } + ] + } + }, + "TableManagerCustomProviderframeworkisComplete2E51021B": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - isComplete (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.isComplete", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkisCompleteServiceRoleDefaultPolicy4BCAB84C", + "TableManagerCustomProviderframeworkisCompleteServiceRole926CCCF5" + ] + }, + "TableManagerCustomProviderframeworkisCompleteLogRetentionBED1D9F7": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkisComplete2E51021B" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "Roles": [ + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + } + ] + } + }, + "TableManagerCustomProviderframeworkonTimeoutC98D33BB": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "7382a0addb9f34974a1ea6c6c9b063882af874828f366f5c93b2b7b64db15c94.zip" + }, + "Description": "AWS CDK resource provider framework - onTimeout (amplify-testAppId-testBranchName-branch-7d6f6c854a/data/amplifyData/AmplifyTableManager/TableManagerCustomProvider)", + "Environment": { + "Variables": { + "USER_ON_EVENT_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerOnEventHandler8779E150", + "Arn" + ] + }, + "USER_IS_COMPLETE_FUNCTION_ARN": { + "Fn::GetAtt": [ + "TableManagerIsCompleteHandler63238667", + "Arn" + ] + } + } + }, + "Handler": "framework.onTimeout", + "Role": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8", + "Arn" + ] + }, + "Runtime": "nodejs18.x", + "Timeout": 900 + }, + "DependsOn": [ + "TableManagerCustomProviderframeworkonTimeoutServiceRoleDefaultPolicyF1D89219", + "TableManagerCustomProviderframeworkonTimeoutServiceRoleC0D4F3A8" + ] + }, + "TableManagerCustomProviderframeworkonTimeoutLogRetention3A93F510": { + "Type": "Custom::LogRetention", + "Properties": { + "ServiceToken": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A", + "Arn" + ] + }, + "LogGroupName": { + "Fn::Join": [ + "", + [ + "/aws/lambda/", + { + "Ref": "TableManagerCustomProviderframeworkonTimeoutC98D33BB" + } + ] + ] + }, + "RetentionInDays": 30 + } + }, + "TableManagerCustomProviderwaiterstatemachineRole9616A97E": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": { + "Fn::FindInMap": [ + "ServiceprincipalMap", + { + "Ref": "AWS::Region" + }, + "states" + ] + } + } + } + ], + "Version": "2012-10-17" + } + } + }, + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + }, + { + "Action": "lambda:InvokeFunction", + "Effect": "Allow", + "Resource": [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + { + "Fn::Join": [ + "", + [ + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + ":*" + ] + ] + } + ] + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "Roles": [ + { + "Ref": "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + } + ] + } + }, + "TableManagerCustomProviderwaiterstatemachine46E6141A": { + "Type": "AWS::StepFunctions::StateMachine", + "Properties": { + "DefinitionString": { + "Fn::Join": [ + "", + [ + "{\"StartAt\":\"framework-isComplete-task\",\"States\":{\"framework-isComplete-task\":{\"End\":true,\"Retry\":[{\"ErrorEquals\":[\"States.ALL\"],\"IntervalSeconds\":30,\"MaxAttempts\":240,\"BackoffRate\":1}],\"Catch\":[{\"ErrorEquals\":[\"States.ALL\"],\"Next\":\"framework-onTimeout-task\"}],\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkisComplete2E51021B", + "Arn" + ] + }, + "\"},\"framework-onTimeout-task\":{\"End\":true,\"Type\":\"Task\",\"Resource\":\"", + { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonTimeoutC98D33BB", + "Arn" + ] + }, + "\"}}}" + ] + ] + }, + "RoleArn": { + "Fn::GetAtt": [ + "TableManagerCustomProviderwaiterstatemachineRole9616A97E", + "Arn" + ] + } + }, + "DependsOn": [ + "TableManagerCustomProviderwaiterstatemachineRoleDefaultPolicy485A85C2", + "TableManagerCustomProviderwaiterstatemachineRole9616A97E" + ] + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB": { + "Type": "AWS::IAM::Role", + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": "sts:AssumeRole", + "Effect": "Allow", + "Principal": { + "Service": "lambda.amazonaws.com" + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Join": [ + "", + [ + "arn:", + { + "Ref": "AWS::Partition" + }, + ":iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" + ] + ] + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB": { + "Type": "AWS::IAM::Policy", + "Properties": { + "PolicyDocument": { + "Statement": [ + { + "Action": [ + "logs:PutRetentionPolicy", + "logs:DeleteRetentionPolicy" + ], + "Effect": "Allow", + "Resource": "*" + } + ], + "Version": "2012-10-17" + }, + "PolicyName": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "Roles": [ + { + "Ref": "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + } + ] + } + }, + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aFD4BFC8A": { + "Type": "AWS::Lambda::Function", + "Properties": { + "Handler": "index.handler", + "Runtime": "nodejs18.x", + "Timeout": 900, + "Code": { + "S3Bucket": { + "Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}" + }, + "S3Key": "5bc602ecde93c947efe5899ae355f999986a1acbe610b1c0b9c468d738857555.zip" + }, + "Role": { + "Fn::GetAtt": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB", + "Arn" + ] + } + }, + "DependsOn": [ + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRoleDefaultPolicyADDA7DEB", + "LogRetentionaae0aa3c5b4d4f87b02d85b201efdd8aServiceRole9741ECFB" + ] + } + }, + "Mappings": { + "ServiceprincipalMap": { + "af-south-1": { + "states": "states.af-south-1.amazonaws.com" + }, + "ap-east-1": { + "states": "states.ap-east-1.amazonaws.com" + }, + "ap-northeast-1": { + "states": "states.ap-northeast-1.amazonaws.com" + }, + "ap-northeast-2": { + "states": "states.ap-northeast-2.amazonaws.com" + }, + "ap-northeast-3": { + "states": "states.ap-northeast-3.amazonaws.com" + }, + "ap-south-1": { + "states": "states.ap-south-1.amazonaws.com" + }, + "ap-south-2": { + "states": "states.ap-south-2.amazonaws.com" + }, + "ap-southeast-1": { + "states": "states.ap-southeast-1.amazonaws.com" + }, + "ap-southeast-2": { + "states": "states.ap-southeast-2.amazonaws.com" + }, + "ap-southeast-3": { + "states": "states.ap-southeast-3.amazonaws.com" + }, + "ap-southeast-4": { + "states": "states.ap-southeast-4.amazonaws.com" + }, + "ca-central-1": { + "states": "states.ca-central-1.amazonaws.com" + }, + "cn-north-1": { + "states": "states.cn-north-1.amazonaws.com" + }, + "cn-northwest-1": { + "states": "states.cn-northwest-1.amazonaws.com" + }, + "eu-central-1": { + "states": "states.eu-central-1.amazonaws.com" + }, + "eu-central-2": { + "states": "states.eu-central-2.amazonaws.com" + }, + "eu-north-1": { + "states": "states.eu-north-1.amazonaws.com" + }, + "eu-south-1": { + "states": "states.eu-south-1.amazonaws.com" + }, + "eu-south-2": { + "states": "states.eu-south-2.amazonaws.com" + }, + "eu-west-1": { + "states": "states.eu-west-1.amazonaws.com" + }, + "eu-west-2": { + "states": "states.eu-west-2.amazonaws.com" + }, + "eu-west-3": { + "states": "states.eu-west-3.amazonaws.com" + }, + "il-central-1": { + "states": "states.il-central-1.amazonaws.com" + }, + "me-central-1": { + "states": "states.me-central-1.amazonaws.com" + }, + "me-south-1": { + "states": "states.me-south-1.amazonaws.com" + }, + "sa-east-1": { + "states": "states.sa-east-1.amazonaws.com" + }, + "us-east-1": { + "states": "states.us-east-1.amazonaws.com" + }, + "us-east-2": { + "states": "states.us-east-2.amazonaws.com" + }, + "us-gov-east-1": { + "states": "states.us-gov-east-1.amazonaws.com" + }, + "us-gov-west-1": { + "states": "states.us-gov-west-1.amazonaws.com" + }, + "us-iso-east-1": { + "states": "states.amazonaws.com" + }, + "us-iso-west-1": { + "states": "states.amazonaws.com" + }, + "us-isob-east-1": { + "states": "states.amazonaws.com" + }, + "us-west-1": { + "states": "states.us-west-1.amazonaws.com" + }, + "us-west-2": { + "states": "states.us-west-2.amazonaws.com" + } + } + }, + "Parameters": { + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { + "Type": "String" + } + }, + "Outputs": { + "amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableManagerCustomProviderframeworkonEventE4FBF539Arn": { + "Value": { + "Fn::GetAtt": [ + "TableManagerCustomProviderframeworkonEvent1DFC2ECC", + "Arn" + ] + } + } + } +} \ No newline at end of file diff --git a/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json b/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json index fc85cce8ac..a36d4b3125 100644 --- a/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json +++ b/packages/integration-tests/test-projects/standalone-data-sandbox-mode/expected-cdk-out/amplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataTodo80505FFF.nested.template.json @@ -37,6 +37,9 @@ ], "Description": "Enable server side encryption powered by KMS." }, + "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E": { + "Type": "String" + }, "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId": { "Type": "String" }, @@ -81,42 +84,37 @@ } }, "Resources": { - "TodoTable585F1D6B": { - "Type": "AWS::DynamoDB::Table", + "TodoTable": { + "Type": "Custom::AmplifyDynamoDBTable", "Properties": { - "AttributeDefinitions": [ + "ServiceToken": { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerNestedStackAmplifyTableManagerNestedStackResource8C0952BCOutputsamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataAmplifyTableManagerTableD81D951E" + }, + "tableName": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "attributeDefinitions": [ { - "AttributeName": "id", - "AttributeType": "S" + "attributeName": "id", + "attributeType": "S" } ], - "BillingMode": { - "Fn::If": [ - "ShouldUsePayPerRequestBilling", - "PAY_PER_REQUEST", - { - "Ref": "AWS::NoValue" - } - ] - }, - "KeySchema": [ + "keySchema": [ { - "AttributeName": "id", - "KeyType": "HASH" + "attributeName": "id", + "keyType": "HASH" } ], - "PointInTimeRecoverySpecification": { - "Fn::If": [ - "ShouldUsePointInTimeRecovery", - { - "PointInTimeRecoveryEnabled": true - }, - { - "Ref": "AWS::NoValue" - } - ] - }, - "ProvisionedThroughput": { + "provisionedThroughput": { "Fn::If": [ "ShouldUsePayPerRequestBilling", { @@ -132,8 +130,8 @@ } ] }, - "SSESpecification": { - "SSEEnabled": { + "sseSpecification": { + "sseEnabled": { "Fn::If": [ "ShouldUseServerSideEncryption", true, @@ -141,19 +139,29 @@ ] } }, - "StreamSpecification": { - "StreamViewType": "NEW_AND_OLD_IMAGES" + "streamSpecification": { + "streamViewType": "NEW_AND_OLD_IMAGES" }, - "TableName": { - "Fn::Join": [ - "", - [ - "Todo-", - { - "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" - }, - "-NONE" - ] + "allowDestructiveGraphqlSchemaUpdates": false, + "replaceTableUponGsiUpdate": false, + "pointInTimeRecoverySpecification": { + "Fn::If": [ + "ShouldUsePointInTimeRecovery", + { + "PointInTimeRecoveryEnabled": true + }, + { + "Ref": "AWS::NoValue" + } + ] + }, + "billingMode": { + "Fn::If": [ + "ShouldUsePayPerRequestBilling", + "PAY_PER_REQUEST", + { + "Ref": "AWS::NoValue" + } ] } }, @@ -213,8 +221,8 @@ "Resource": [ { "Fn::GetAtt": [ - "TodoTable585F1D6B", - "Arn" + "TodoTable", + "TableArn" ] }, { @@ -313,7 +321,30 @@ "Ref": "AWS::Region" }, "TableName": { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] } }, "Name": "TodoTable", @@ -405,7 +436,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" ] @@ -491,7 +545,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" ] @@ -600,7 +677,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" ] @@ -709,7 +809,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" ] @@ -795,7 +918,30 @@ }, "\"))\n$util.qr($ctx.stash.put(\"connectionAttributes\", {}))\n$util.qr($ctx.stash.put(\"tableName\", \"", { - "Ref": "TodoTable585F1D6B" + "Fn::Select": [ + 1, + { + "Fn::Split": [ + "/", + { + "Fn::Select": [ + 5, + { + "Fn::Split": [ + ":", + { + "Fn::GetAtt": [ + "TodoTable", + "TableArn" + ] + } + ] + } + ] + } + ] + } + ] }, "\"))\n$util.qr($ctx.stash.put(\"adminRoles\", []))\n$util.toJson({})" ] @@ -1033,5 +1179,57 @@ "TypeName": "Subscription" } } + }, + "Outputs": { + "GetAttTodoTableStreamArn": { + "Description": "Your DynamoDB table StreamArn.", + "Value": { + "Fn::GetAtt": [ + "TodoTable", + "TableStreamArn" + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:StreamArn" + ] + ] + } + } + }, + "GetAttTodoTableName": { + "Description": "Your DynamoDB table name.", + "Value": { + "Fn::Join": [ + "", + [ + "Todo-", + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "-NONE" + ] + ] + }, + "Export": { + "Name": { + "Fn::Join": [ + ":", + [ + { + "Ref": "referencetoamplifytestAppIdtestBranchNamebranch7d6f6c854adataamplifyDataGraphQLAPI8E80FACEApiId" + }, + "GetAtt:TodoTable:Name" + ] + ] + } + } + } } } \ No newline at end of file