From 4e210c78d6a546daa127c01371be59c1b5caf409 Mon Sep 17 00:00:00 2001 From: Slava Senchenko Date: Mon, 27 Mar 2023 15:27:36 -0700 Subject: [PATCH 1/3] Include section in DataSource logical id --- samtranslator/model/sam_resources.py | 2 +- ...phqlapi_ddb_datasource_all_properties.yaml | 29 +++++++ temp/graphqlapi_ddb_datasource_connector.yaml | 23 ++++++ ...aphqlapi_function_datasource_property.yaml | 24 ++++++ ...tion_overwrite_resolver_code_settings.yaml | 29 +++++++ ...i_function_use_resolver_code_settings.yaml | 30 ++++++++ ...phqlapi_ddb_datasource_all_properties.json | 2 +- .../graphqlapi_ddb_datasource_connector.json | 76 +++++++++---------- ...aphqlapi_function_datasource_property.json | 2 +- ...tion_overwrite_resolver_code_settings.json | 2 +- ...i_function_use_resolver_code_settings.json | 2 +- ...phqlapi_ddb_datasource_all_properties.json | 2 +- .../graphqlapi_ddb_datasource_connector.json | 76 +++++++++---------- ...aphqlapi_function_datasource_property.json | 2 +- ...tion_overwrite_resolver_code_settings.json | 2 +- ...i_function_use_resolver_code_settings.json | 2 +- ...phqlapi_ddb_datasource_all_properties.json | 2 +- .../graphqlapi_ddb_datasource_connector.json | 76 +++++++++---------- ...aphqlapi_function_datasource_property.json | 2 +- ...tion_overwrite_resolver_code_settings.json | 2 +- ...i_function_use_resolver_code_settings.json | 2 +- 21 files changed, 262 insertions(+), 127 deletions(-) create mode 100644 temp/graphqlapi_ddb_datasource_all_properties.yaml create mode 100644 temp/graphqlapi_ddb_datasource_connector.yaml create mode 100644 temp/graphqlapi_function_datasource_property.yaml create mode 100644 temp/graphqlapi_function_overwrite_resolver_code_settings.yaml create mode 100644 temp/graphqlapi_function_use_resolver_code_settings.yaml diff --git a/samtranslator/model/sam_resources.py b/samtranslator/model/sam_resources.py index 7f9b79e97..09a5f65b2 100644 --- a/samtranslator/model/sam_resources.py +++ b/samtranslator/model/sam_resources.py @@ -2286,7 +2286,7 @@ def _construct_ddb_datasources( resources: List[Resource] = [] for relative_id, ddb_datasource in ddb_datasources.items(): - datasource_logical_id = self.logical_id + relative_id + datasource_logical_id = f"{self.logical_id}DynamoDBDataSources{relative_id}" cfn_datasource = DataSource( logical_id=datasource_logical_id, depends_on=self.depends_on, attributes=self.resource_attributes ) diff --git a/temp/graphqlapi_ddb_datasource_all_properties.yaml b/temp/graphqlapi_ddb_datasource_all_properties.yaml new file mode 100644 index 000000000..a83db185d --- /dev/null +++ b/temp/graphqlapi_ddb_datasource_all_properties.yaml @@ -0,0 +1,29 @@ +Transform: AWS::Serverless-2016-10-31 +Resources: + SuperCoolAPI: + Type: AWS::Serverless::GraphQLApi + Properties: + Name: SomeApi + SchemaInline: | + type Mutation { + addTodo(id: ID!, name: String, description: String, priority: Int): Todo + } + XrayEnabled: true + Auth: + Type: AWS_IAM + Tags: + key1: value1 + key2: value2 + DynamoDBDataSources: + MyDataSource: + TableName: some-table + ServiceRoleArn: some-arn + Name: AwesomeDataSourceName + Description: This data source is special to me + Region: na-west-2 + UseCallerCredentials: true + Versioned: true + DeltaSync: + BaseTableTTL: '60' + DeltaSyncTableName: '60' + DeltaSyncTableTTL: '60' diff --git a/temp/graphqlapi_ddb_datasource_connector.yaml b/temp/graphqlapi_ddb_datasource_connector.yaml new file mode 100644 index 000000000..c3b09c7e1 --- /dev/null +++ b/temp/graphqlapi_ddb_datasource_connector.yaml @@ -0,0 +1,23 @@ +Transform: AWS::Serverless-2016-10-31 +Resources: + SuperCoolAPI: + Type: AWS::Serverless::GraphQLApi + Properties: + Name: SomeApi + SchemaInline: | + type Mutation { + addTodo(id: ID!, name: String, description: String, priority: Int): Todo + } + XrayEnabled: true + Auth: + Type: AWS_IAM + Tags: + key1: value1 + key2: value2 + DynamoDBDataSources: + MyDataSource: + TableName: some-table + TableArn: big-arn + AnotherDataSource: + TableName: cool-table + TableArn: table-arn diff --git a/temp/graphqlapi_function_datasource_property.yaml b/temp/graphqlapi_function_datasource_property.yaml new file mode 100644 index 000000000..94b835642 --- /dev/null +++ b/temp/graphqlapi_function_datasource_property.yaml @@ -0,0 +1,24 @@ +Transform: AWS::Serverless-2016-10-31 +Resources: + SuperCoolAPI: + Type: AWS::Serverless::GraphQLApi + Properties: + Name: SomeApi + SchemaInline: | + type Mutation { + addTodo(id: ID!, name: String, description: String, priority: Int): Todo + } + Auth: + Type: AWS_IAM + DynamoDBDataSources: + MyDataSource: + Name: MyDataSource + TableName: SomeTable + ServiceRoleArn: SomeRoleArn + Functions: + MyFunction: + InlineCode: this is my epic code + DataSource: MyDataSource + Runtime: + Name: some-runtime + Version: 1.2.3 diff --git a/temp/graphqlapi_function_overwrite_resolver_code_settings.yaml b/temp/graphqlapi_function_overwrite_resolver_code_settings.yaml new file mode 100644 index 000000000..81a30120f --- /dev/null +++ b/temp/graphqlapi_function_overwrite_resolver_code_settings.yaml @@ -0,0 +1,29 @@ +Transform: AWS::Serverless-2016-10-31 +Resources: + SuperCoolAPI: + Type: AWS::Serverless::GraphQLApi + Properties: + Name: SomeApi + SchemaInline: | + type Mutation { + addTodo(id: ID!, name: String, description: String, priority: Int): Todo + } + Auth: + Type: AWS_IAM + DynamoDBDataSources: + MyDataSource: + Name: MyDataSource + TableName: SomeTable + ServiceRoleArn: SomeRoleArn + ResolverCodeSettings: + CodeRootPath: path/to/my/code + Runtime: + Name: some-runtime + Version: 1.2.3 + Functions: + MyFunction: + DataSource: MyDataSource + CodeUri: not-code-settings-uri + Runtime: + Name: not-code-settings-runtime + Version: 7.8.9 diff --git a/temp/graphqlapi_function_use_resolver_code_settings.yaml b/temp/graphqlapi_function_use_resolver_code_settings.yaml new file mode 100644 index 000000000..6c1678b72 --- /dev/null +++ b/temp/graphqlapi_function_use_resolver_code_settings.yaml @@ -0,0 +1,30 @@ +Transform: AWS::Serverless-2016-10-31 +Resources: + SuperCoolAPI: + Type: AWS::Serverless::GraphQLApi + Properties: + Name: SomeApi + SchemaInline: | + type Mutation { + addTodo(id: ID!, name: String, description: String, priority: Int): Todo + } + Auth: + Type: AWS_IAM + DynamoDBDataSources: + MyDataSource: + Name: MyDataSource + TableName: SomeTable + ServiceRoleArn: SomeRoleArn + ResolverCodeSettings: + CodeRootPath: path/to/my/code + Runtime: + Name: some-runtime + Version: 1.2.3 + Functions: + MyFunction: + DataSource: MyDataSource + Sync: + ConflictDetection: VERSION + ConflictHandler: LAMBDA + LambdaConflictHandlerConfig: + LambdaConflictHandlerArn: my-lambda-arn diff --git a/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_all_properties.json b/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_all_properties.json index 9910fb128..1d31ce406 100644 --- a/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_all_properties.json +++ b/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_all_properties.json @@ -53,7 +53,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_connector.json b/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_connector.json index 621d90c21..3663a095e 100644 --- a/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_connector.json +++ b/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_connector.json @@ -27,7 +27,33 @@ }, "Type": "AWS::AppSync::GraphQLApi" }, - "SuperCoolAPIAnotherDataSource": { + "SuperCoolAPICloudWatchRole": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "appsync.amazonaws.com" + ] + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSAppSyncPushToCloudWatchLogs" + } + ] + }, + "Type": "AWS::IAM::Role" + }, + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ @@ -44,7 +70,7 @@ "Name": "AnotherDataSource", "ServiceRoleArn": { "Fn::GetAtt": [ - "SuperCoolAPIAnotherDataSourceRole", + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole", "Arn" ] }, @@ -52,7 +78,7 @@ }, "Type": "AWS::AppSync::DataSource" }, - "SuperCoolAPIAnotherDataSourceRole": { + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -73,10 +99,10 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIAnotherDataSourceToTableConnectorPolicy": { + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceToTableConnectorPolicy": { "Metadata": { "aws:sam:connectors": { - "SuperCoolAPIAnotherDataSourceToTableConnector": { + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceToTableConnector": { "Destination": { "Type": "AWS::DynamoDB::Table" }, @@ -139,39 +165,13 @@ }, "Roles": [ { - "Ref": "SuperCoolAPIAnotherDataSourceRole" + "Ref": "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole" } ] }, "Type": "AWS::IAM::ManagedPolicy" }, - "SuperCoolAPICloudWatchRole": { - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": [ - "sts:AssumeRole" - ], - "Effect": "Allow", - "Principal": { - "Service": [ - "appsync.amazonaws.com" - ] - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSAppSyncPushToCloudWatchLogs" - } - ] - }, - "Type": "AWS::IAM::Role" - }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ @@ -188,7 +188,7 @@ "Name": "MyDataSource", "ServiceRoleArn": { "Fn::GetAtt": [ - "SuperCoolAPIMyDataSourceRole", + "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole", "Arn" ] }, @@ -196,7 +196,7 @@ }, "Type": "AWS::AppSync::DataSource" }, - "SuperCoolAPIMyDataSourceRole": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -217,10 +217,10 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSourceToTableConnectorPolicy": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSourceToTableConnectorPolicy": { "Metadata": { "aws:sam:connectors": { - "SuperCoolAPIMyDataSourceToTableConnector": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSourceToTableConnector": { "Destination": { "Type": "AWS::DynamoDB::Table" }, @@ -283,7 +283,7 @@ }, "Roles": [ { - "Ref": "SuperCoolAPIMyDataSourceRole" + "Ref": "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole" } ] }, diff --git a/tests/translator/output/aws-cn/graphqlapi_function_datasource_property.json b/tests/translator/output/aws-cn/graphqlapi_function_datasource_property.json index a4b49cf2b..1958ea172 100644 --- a/tests/translator/output/aws-cn/graphqlapi_function_datasource_property.json +++ b/tests/translator/output/aws-cn/graphqlapi_function_datasource_property.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/graphqlapi_function_overwrite_resolver_code_settings.json b/tests/translator/output/aws-cn/graphqlapi_function_overwrite_resolver_code_settings.json index 02fd93dd8..0a6e6c8e0 100644 --- a/tests/translator/output/aws-cn/graphqlapi_function_overwrite_resolver_code_settings.json +++ b/tests/translator/output/aws-cn/graphqlapi_function_overwrite_resolver_code_settings.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/graphqlapi_function_use_resolver_code_settings.json b/tests/translator/output/aws-cn/graphqlapi_function_use_resolver_code_settings.json index 72acede71..6bda9dff7 100644 --- a/tests/translator/output/aws-cn/graphqlapi_function_use_resolver_code_settings.json +++ b/tests/translator/output/aws-cn/graphqlapi_function_use_resolver_code_settings.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_all_properties.json b/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_all_properties.json index 9910fb128..1d31ce406 100644 --- a/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_all_properties.json +++ b/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_all_properties.json @@ -53,7 +53,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_connector.json b/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_connector.json index 621d90c21..3663a095e 100644 --- a/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_connector.json +++ b/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_connector.json @@ -27,7 +27,33 @@ }, "Type": "AWS::AppSync::GraphQLApi" }, - "SuperCoolAPIAnotherDataSource": { + "SuperCoolAPICloudWatchRole": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "appsync.amazonaws.com" + ] + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSAppSyncPushToCloudWatchLogs" + } + ] + }, + "Type": "AWS::IAM::Role" + }, + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ @@ -44,7 +70,7 @@ "Name": "AnotherDataSource", "ServiceRoleArn": { "Fn::GetAtt": [ - "SuperCoolAPIAnotherDataSourceRole", + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole", "Arn" ] }, @@ -52,7 +78,7 @@ }, "Type": "AWS::AppSync::DataSource" }, - "SuperCoolAPIAnotherDataSourceRole": { + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -73,10 +99,10 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIAnotherDataSourceToTableConnectorPolicy": { + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceToTableConnectorPolicy": { "Metadata": { "aws:sam:connectors": { - "SuperCoolAPIAnotherDataSourceToTableConnector": { + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceToTableConnector": { "Destination": { "Type": "AWS::DynamoDB::Table" }, @@ -139,39 +165,13 @@ }, "Roles": [ { - "Ref": "SuperCoolAPIAnotherDataSourceRole" + "Ref": "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole" } ] }, "Type": "AWS::IAM::ManagedPolicy" }, - "SuperCoolAPICloudWatchRole": { - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": [ - "sts:AssumeRole" - ], - "Effect": "Allow", - "Principal": { - "Service": [ - "appsync.amazonaws.com" - ] - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSAppSyncPushToCloudWatchLogs" - } - ] - }, - "Type": "AWS::IAM::Role" - }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ @@ -188,7 +188,7 @@ "Name": "MyDataSource", "ServiceRoleArn": { "Fn::GetAtt": [ - "SuperCoolAPIMyDataSourceRole", + "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole", "Arn" ] }, @@ -196,7 +196,7 @@ }, "Type": "AWS::AppSync::DataSource" }, - "SuperCoolAPIMyDataSourceRole": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -217,10 +217,10 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSourceToTableConnectorPolicy": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSourceToTableConnectorPolicy": { "Metadata": { "aws:sam:connectors": { - "SuperCoolAPIMyDataSourceToTableConnector": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSourceToTableConnector": { "Destination": { "Type": "AWS::DynamoDB::Table" }, @@ -283,7 +283,7 @@ }, "Roles": [ { - "Ref": "SuperCoolAPIMyDataSourceRole" + "Ref": "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole" } ] }, diff --git a/tests/translator/output/aws-us-gov/graphqlapi_function_datasource_property.json b/tests/translator/output/aws-us-gov/graphqlapi_function_datasource_property.json index a4b49cf2b..1958ea172 100644 --- a/tests/translator/output/aws-us-gov/graphqlapi_function_datasource_property.json +++ b/tests/translator/output/aws-us-gov/graphqlapi_function_datasource_property.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/graphqlapi_function_overwrite_resolver_code_settings.json b/tests/translator/output/aws-us-gov/graphqlapi_function_overwrite_resolver_code_settings.json index 02fd93dd8..0a6e6c8e0 100644 --- a/tests/translator/output/aws-us-gov/graphqlapi_function_overwrite_resolver_code_settings.json +++ b/tests/translator/output/aws-us-gov/graphqlapi_function_overwrite_resolver_code_settings.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/graphqlapi_function_use_resolver_code_settings.json b/tests/translator/output/aws-us-gov/graphqlapi_function_use_resolver_code_settings.json index 72acede71..6bda9dff7 100644 --- a/tests/translator/output/aws-us-gov/graphqlapi_function_use_resolver_code_settings.json +++ b/tests/translator/output/aws-us-gov/graphqlapi_function_use_resolver_code_settings.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/graphqlapi_ddb_datasource_all_properties.json b/tests/translator/output/graphqlapi_ddb_datasource_all_properties.json index 9910fb128..1d31ce406 100644 --- a/tests/translator/output/graphqlapi_ddb_datasource_all_properties.json +++ b/tests/translator/output/graphqlapi_ddb_datasource_all_properties.json @@ -53,7 +53,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/graphqlapi_ddb_datasource_connector.json b/tests/translator/output/graphqlapi_ddb_datasource_connector.json index 621d90c21..3663a095e 100644 --- a/tests/translator/output/graphqlapi_ddb_datasource_connector.json +++ b/tests/translator/output/graphqlapi_ddb_datasource_connector.json @@ -27,7 +27,33 @@ }, "Type": "AWS::AppSync::GraphQLApi" }, - "SuperCoolAPIAnotherDataSource": { + "SuperCoolAPICloudWatchRole": { + "Properties": { + "AssumeRolePolicyDocument": { + "Statement": [ + { + "Action": [ + "sts:AssumeRole" + ], + "Effect": "Allow", + "Principal": { + "Service": [ + "appsync.amazonaws.com" + ] + } + } + ], + "Version": "2012-10-17" + }, + "ManagedPolicyArns": [ + { + "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSAppSyncPushToCloudWatchLogs" + } + ] + }, + "Type": "AWS::IAM::Role" + }, + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ @@ -44,7 +70,7 @@ "Name": "AnotherDataSource", "ServiceRoleArn": { "Fn::GetAtt": [ - "SuperCoolAPIAnotherDataSourceRole", + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole", "Arn" ] }, @@ -52,7 +78,7 @@ }, "Type": "AWS::AppSync::DataSource" }, - "SuperCoolAPIAnotherDataSourceRole": { + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -73,10 +99,10 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIAnotherDataSourceToTableConnectorPolicy": { + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceToTableConnectorPolicy": { "Metadata": { "aws:sam:connectors": { - "SuperCoolAPIAnotherDataSourceToTableConnector": { + "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceToTableConnector": { "Destination": { "Type": "AWS::DynamoDB::Table" }, @@ -139,39 +165,13 @@ }, "Roles": [ { - "Ref": "SuperCoolAPIAnotherDataSourceRole" + "Ref": "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole" } ] }, "Type": "AWS::IAM::ManagedPolicy" }, - "SuperCoolAPICloudWatchRole": { - "Properties": { - "AssumeRolePolicyDocument": { - "Statement": [ - { - "Action": [ - "sts:AssumeRole" - ], - "Effect": "Allow", - "Principal": { - "Service": [ - "appsync.amazonaws.com" - ] - } - } - ], - "Version": "2012-10-17" - }, - "ManagedPolicyArns": [ - { - "Fn::Sub": "arn:${AWS::Partition}:iam::aws:policy/service-role/AWSAppSyncPushToCloudWatchLogs" - } - ] - }, - "Type": "AWS::IAM::Role" - }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ @@ -188,7 +188,7 @@ "Name": "MyDataSource", "ServiceRoleArn": { "Fn::GetAtt": [ - "SuperCoolAPIMyDataSourceRole", + "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole", "Arn" ] }, @@ -196,7 +196,7 @@ }, "Type": "AWS::AppSync::DataSource" }, - "SuperCoolAPIMyDataSourceRole": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -217,10 +217,10 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSourceToTableConnectorPolicy": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSourceToTableConnectorPolicy": { "Metadata": { "aws:sam:connectors": { - "SuperCoolAPIMyDataSourceToTableConnector": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSourceToTableConnector": { "Destination": { "Type": "AWS::DynamoDB::Table" }, @@ -283,7 +283,7 @@ }, "Roles": [ { - "Ref": "SuperCoolAPIMyDataSourceRole" + "Ref": "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole" } ] }, diff --git a/tests/translator/output/graphqlapi_function_datasource_property.json b/tests/translator/output/graphqlapi_function_datasource_property.json index a4b49cf2b..1958ea172 100644 --- a/tests/translator/output/graphqlapi_function_datasource_property.json +++ b/tests/translator/output/graphqlapi_function_datasource_property.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/graphqlapi_function_overwrite_resolver_code_settings.json b/tests/translator/output/graphqlapi_function_overwrite_resolver_code_settings.json index 02fd93dd8..0a6e6c8e0 100644 --- a/tests/translator/output/graphqlapi_function_overwrite_resolver_code_settings.json +++ b/tests/translator/output/graphqlapi_function_overwrite_resolver_code_settings.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/graphqlapi_function_use_resolver_code_settings.json b/tests/translator/output/graphqlapi_function_use_resolver_code_settings.json index 72acede71..6bda9dff7 100644 --- a/tests/translator/output/graphqlapi_function_use_resolver_code_settings.json +++ b/tests/translator/output/graphqlapi_function_use_resolver_code_settings.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIMyDataSource": { + "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ From 6ccbd27411f51860534fcba15c82682406e661f7 Mon Sep 17 00:00:00 2001 From: Slava Senchenko Date: Mon, 27 Mar 2023 16:12:25 -0700 Subject: [PATCH 2/3] Update samtranslator/model/sam_resources.py Co-authored-by: _sam <3804518+aahung@users.noreply.github.com> --- samtranslator/model/sam_resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samtranslator/model/sam_resources.py b/samtranslator/model/sam_resources.py index 09a5f65b2..88c14c412 100644 --- a/samtranslator/model/sam_resources.py +++ b/samtranslator/model/sam_resources.py @@ -2286,7 +2286,7 @@ def _construct_ddb_datasources( resources: List[Resource] = [] for relative_id, ddb_datasource in ddb_datasources.items(): - datasource_logical_id = f"{self.logical_id}DynamoDBDataSources{relative_id}" + datasource_logical_id = f"{self.logical_id}DynamoDBDataSource{relative_id}" cfn_datasource = DataSource( logical_id=datasource_logical_id, depends_on=self.depends_on, attributes=self.resource_attributes ) From 0271758a546f7ce7851d0cd3e04206d191d32f0a Mon Sep 17 00:00:00 2001 From: Slava Senchenko Date: Tue, 28 Mar 2023 10:43:18 -0700 Subject: [PATCH 3/3] updated tests --- ...phqlapi_ddb_datasource_all_properties.yaml | 29 ------------------ temp/graphqlapi_ddb_datasource_connector.yaml | 23 -------------- ...aphqlapi_function_datasource_property.yaml | 24 --------------- ...tion_overwrite_resolver_code_settings.yaml | 29 ------------------ ...i_function_use_resolver_code_settings.yaml | 30 ------------------- ...phqlapi_ddb_datasource_all_properties.json | 2 +- .../graphqlapi_ddb_datasource_connector.json | 24 +++++++-------- ...aphqlapi_function_datasource_property.json | 2 +- ...tion_overwrite_resolver_code_settings.json | 2 +- ...i_function_use_resolver_code_settings.json | 2 +- ...phqlapi_ddb_datasource_all_properties.json | 2 +- .../graphqlapi_ddb_datasource_connector.json | 24 +++++++-------- ...aphqlapi_function_datasource_property.json | 2 +- ...tion_overwrite_resolver_code_settings.json | 2 +- ...i_function_use_resolver_code_settings.json | 2 +- ...phqlapi_ddb_datasource_all_properties.json | 2 +- .../graphqlapi_ddb_datasource_connector.json | 24 +++++++-------- ...aphqlapi_function_datasource_property.json | 2 +- ...tion_overwrite_resolver_code_settings.json | 2 +- ...i_function_use_resolver_code_settings.json | 2 +- 20 files changed, 48 insertions(+), 183 deletions(-) delete mode 100644 temp/graphqlapi_ddb_datasource_all_properties.yaml delete mode 100644 temp/graphqlapi_ddb_datasource_connector.yaml delete mode 100644 temp/graphqlapi_function_datasource_property.yaml delete mode 100644 temp/graphqlapi_function_overwrite_resolver_code_settings.yaml delete mode 100644 temp/graphqlapi_function_use_resolver_code_settings.yaml diff --git a/temp/graphqlapi_ddb_datasource_all_properties.yaml b/temp/graphqlapi_ddb_datasource_all_properties.yaml deleted file mode 100644 index a83db185d..000000000 --- a/temp/graphqlapi_ddb_datasource_all_properties.yaml +++ /dev/null @@ -1,29 +0,0 @@ -Transform: AWS::Serverless-2016-10-31 -Resources: - SuperCoolAPI: - Type: AWS::Serverless::GraphQLApi - Properties: - Name: SomeApi - SchemaInline: | - type Mutation { - addTodo(id: ID!, name: String, description: String, priority: Int): Todo - } - XrayEnabled: true - Auth: - Type: AWS_IAM - Tags: - key1: value1 - key2: value2 - DynamoDBDataSources: - MyDataSource: - TableName: some-table - ServiceRoleArn: some-arn - Name: AwesomeDataSourceName - Description: This data source is special to me - Region: na-west-2 - UseCallerCredentials: true - Versioned: true - DeltaSync: - BaseTableTTL: '60' - DeltaSyncTableName: '60' - DeltaSyncTableTTL: '60' diff --git a/temp/graphqlapi_ddb_datasource_connector.yaml b/temp/graphqlapi_ddb_datasource_connector.yaml deleted file mode 100644 index c3b09c7e1..000000000 --- a/temp/graphqlapi_ddb_datasource_connector.yaml +++ /dev/null @@ -1,23 +0,0 @@ -Transform: AWS::Serverless-2016-10-31 -Resources: - SuperCoolAPI: - Type: AWS::Serverless::GraphQLApi - Properties: - Name: SomeApi - SchemaInline: | - type Mutation { - addTodo(id: ID!, name: String, description: String, priority: Int): Todo - } - XrayEnabled: true - Auth: - Type: AWS_IAM - Tags: - key1: value1 - key2: value2 - DynamoDBDataSources: - MyDataSource: - TableName: some-table - TableArn: big-arn - AnotherDataSource: - TableName: cool-table - TableArn: table-arn diff --git a/temp/graphqlapi_function_datasource_property.yaml b/temp/graphqlapi_function_datasource_property.yaml deleted file mode 100644 index 94b835642..000000000 --- a/temp/graphqlapi_function_datasource_property.yaml +++ /dev/null @@ -1,24 +0,0 @@ -Transform: AWS::Serverless-2016-10-31 -Resources: - SuperCoolAPI: - Type: AWS::Serverless::GraphQLApi - Properties: - Name: SomeApi - SchemaInline: | - type Mutation { - addTodo(id: ID!, name: String, description: String, priority: Int): Todo - } - Auth: - Type: AWS_IAM - DynamoDBDataSources: - MyDataSource: - Name: MyDataSource - TableName: SomeTable - ServiceRoleArn: SomeRoleArn - Functions: - MyFunction: - InlineCode: this is my epic code - DataSource: MyDataSource - Runtime: - Name: some-runtime - Version: 1.2.3 diff --git a/temp/graphqlapi_function_overwrite_resolver_code_settings.yaml b/temp/graphqlapi_function_overwrite_resolver_code_settings.yaml deleted file mode 100644 index 81a30120f..000000000 --- a/temp/graphqlapi_function_overwrite_resolver_code_settings.yaml +++ /dev/null @@ -1,29 +0,0 @@ -Transform: AWS::Serverless-2016-10-31 -Resources: - SuperCoolAPI: - Type: AWS::Serverless::GraphQLApi - Properties: - Name: SomeApi - SchemaInline: | - type Mutation { - addTodo(id: ID!, name: String, description: String, priority: Int): Todo - } - Auth: - Type: AWS_IAM - DynamoDBDataSources: - MyDataSource: - Name: MyDataSource - TableName: SomeTable - ServiceRoleArn: SomeRoleArn - ResolverCodeSettings: - CodeRootPath: path/to/my/code - Runtime: - Name: some-runtime - Version: 1.2.3 - Functions: - MyFunction: - DataSource: MyDataSource - CodeUri: not-code-settings-uri - Runtime: - Name: not-code-settings-runtime - Version: 7.8.9 diff --git a/temp/graphqlapi_function_use_resolver_code_settings.yaml b/temp/graphqlapi_function_use_resolver_code_settings.yaml deleted file mode 100644 index 6c1678b72..000000000 --- a/temp/graphqlapi_function_use_resolver_code_settings.yaml +++ /dev/null @@ -1,30 +0,0 @@ -Transform: AWS::Serverless-2016-10-31 -Resources: - SuperCoolAPI: - Type: AWS::Serverless::GraphQLApi - Properties: - Name: SomeApi - SchemaInline: | - type Mutation { - addTodo(id: ID!, name: String, description: String, priority: Int): Todo - } - Auth: - Type: AWS_IAM - DynamoDBDataSources: - MyDataSource: - Name: MyDataSource - TableName: SomeTable - ServiceRoleArn: SomeRoleArn - ResolverCodeSettings: - CodeRootPath: path/to/my/code - Runtime: - Name: some-runtime - Version: 1.2.3 - Functions: - MyFunction: - DataSource: MyDataSource - Sync: - ConflictDetection: VERSION - ConflictHandler: LAMBDA - LambdaConflictHandlerConfig: - LambdaConflictHandlerArn: my-lambda-arn diff --git a/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_all_properties.json b/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_all_properties.json index 1d31ce406..5193e62b0 100644 --- a/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_all_properties.json +++ b/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_all_properties.json @@ -53,7 +53,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_connector.json b/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_connector.json index 3663a095e..a4fb431a4 100644 --- a/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_connector.json +++ b/tests/translator/output/aws-cn/graphqlapi_ddb_datasource_connector.json @@ -53,7 +53,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSource": { + "SuperCoolAPIDynamoDBDataSourceAnotherDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ @@ -70,7 +70,7 @@ "Name": "AnotherDataSource", "ServiceRoleArn": { "Fn::GetAtt": [ - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole", + "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceRole", "Arn" ] }, @@ -78,7 +78,7 @@ }, "Type": "AWS::AppSync::DataSource" }, - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole": { + "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceRole": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -99,10 +99,10 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceToTableConnectorPolicy": { + "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceToTableConnectorPolicy": { "Metadata": { "aws:sam:connectors": { - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceToTableConnector": { + "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceToTableConnector": { "Destination": { "Type": "AWS::DynamoDB::Table" }, @@ -165,13 +165,13 @@ }, "Roles": [ { - "Ref": "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole" + "Ref": "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceRole" } ] }, "Type": "AWS::IAM::ManagedPolicy" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ @@ -188,7 +188,7 @@ "Name": "MyDataSource", "ServiceRoleArn": { "Fn::GetAtt": [ - "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole", + "SuperCoolAPIDynamoDBDataSourceMyDataSourceRole", "Arn" ] }, @@ -196,7 +196,7 @@ }, "Type": "AWS::AppSync::DataSource" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole": { + "SuperCoolAPIDynamoDBDataSourceMyDataSourceRole": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -217,10 +217,10 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSourceToTableConnectorPolicy": { + "SuperCoolAPIDynamoDBDataSourceMyDataSourceToTableConnectorPolicy": { "Metadata": { "aws:sam:connectors": { - "SuperCoolAPIDynamoDBDataSourcesMyDataSourceToTableConnector": { + "SuperCoolAPIDynamoDBDataSourceMyDataSourceToTableConnector": { "Destination": { "Type": "AWS::DynamoDB::Table" }, @@ -283,7 +283,7 @@ }, "Roles": [ { - "Ref": "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole" + "Ref": "SuperCoolAPIDynamoDBDataSourceMyDataSourceRole" } ] }, diff --git a/tests/translator/output/aws-cn/graphqlapi_function_datasource_property.json b/tests/translator/output/aws-cn/graphqlapi_function_datasource_property.json index 1958ea172..d8edfbe2e 100644 --- a/tests/translator/output/aws-cn/graphqlapi_function_datasource_property.json +++ b/tests/translator/output/aws-cn/graphqlapi_function_datasource_property.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/graphqlapi_function_overwrite_resolver_code_settings.json b/tests/translator/output/aws-cn/graphqlapi_function_overwrite_resolver_code_settings.json index 0a6e6c8e0..d1f973595 100644 --- a/tests/translator/output/aws-cn/graphqlapi_function_overwrite_resolver_code_settings.json +++ b/tests/translator/output/aws-cn/graphqlapi_function_overwrite_resolver_code_settings.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-cn/graphqlapi_function_use_resolver_code_settings.json b/tests/translator/output/aws-cn/graphqlapi_function_use_resolver_code_settings.json index 6bda9dff7..8a05b7a03 100644 --- a/tests/translator/output/aws-cn/graphqlapi_function_use_resolver_code_settings.json +++ b/tests/translator/output/aws-cn/graphqlapi_function_use_resolver_code_settings.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_all_properties.json b/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_all_properties.json index 1d31ce406..5193e62b0 100644 --- a/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_all_properties.json +++ b/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_all_properties.json @@ -53,7 +53,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_connector.json b/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_connector.json index 3663a095e..a4fb431a4 100644 --- a/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_connector.json +++ b/tests/translator/output/aws-us-gov/graphqlapi_ddb_datasource_connector.json @@ -53,7 +53,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSource": { + "SuperCoolAPIDynamoDBDataSourceAnotherDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ @@ -70,7 +70,7 @@ "Name": "AnotherDataSource", "ServiceRoleArn": { "Fn::GetAtt": [ - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole", + "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceRole", "Arn" ] }, @@ -78,7 +78,7 @@ }, "Type": "AWS::AppSync::DataSource" }, - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole": { + "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceRole": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -99,10 +99,10 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceToTableConnectorPolicy": { + "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceToTableConnectorPolicy": { "Metadata": { "aws:sam:connectors": { - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceToTableConnector": { + "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceToTableConnector": { "Destination": { "Type": "AWS::DynamoDB::Table" }, @@ -165,13 +165,13 @@ }, "Roles": [ { - "Ref": "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole" + "Ref": "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceRole" } ] }, "Type": "AWS::IAM::ManagedPolicy" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ @@ -188,7 +188,7 @@ "Name": "MyDataSource", "ServiceRoleArn": { "Fn::GetAtt": [ - "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole", + "SuperCoolAPIDynamoDBDataSourceMyDataSourceRole", "Arn" ] }, @@ -196,7 +196,7 @@ }, "Type": "AWS::AppSync::DataSource" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole": { + "SuperCoolAPIDynamoDBDataSourceMyDataSourceRole": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -217,10 +217,10 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSourceToTableConnectorPolicy": { + "SuperCoolAPIDynamoDBDataSourceMyDataSourceToTableConnectorPolicy": { "Metadata": { "aws:sam:connectors": { - "SuperCoolAPIDynamoDBDataSourcesMyDataSourceToTableConnector": { + "SuperCoolAPIDynamoDBDataSourceMyDataSourceToTableConnector": { "Destination": { "Type": "AWS::DynamoDB::Table" }, @@ -283,7 +283,7 @@ }, "Roles": [ { - "Ref": "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole" + "Ref": "SuperCoolAPIDynamoDBDataSourceMyDataSourceRole" } ] }, diff --git a/tests/translator/output/aws-us-gov/graphqlapi_function_datasource_property.json b/tests/translator/output/aws-us-gov/graphqlapi_function_datasource_property.json index 1958ea172..d8edfbe2e 100644 --- a/tests/translator/output/aws-us-gov/graphqlapi_function_datasource_property.json +++ b/tests/translator/output/aws-us-gov/graphqlapi_function_datasource_property.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/graphqlapi_function_overwrite_resolver_code_settings.json b/tests/translator/output/aws-us-gov/graphqlapi_function_overwrite_resolver_code_settings.json index 0a6e6c8e0..d1f973595 100644 --- a/tests/translator/output/aws-us-gov/graphqlapi_function_overwrite_resolver_code_settings.json +++ b/tests/translator/output/aws-us-gov/graphqlapi_function_overwrite_resolver_code_settings.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/aws-us-gov/graphqlapi_function_use_resolver_code_settings.json b/tests/translator/output/aws-us-gov/graphqlapi_function_use_resolver_code_settings.json index 6bda9dff7..8a05b7a03 100644 --- a/tests/translator/output/aws-us-gov/graphqlapi_function_use_resolver_code_settings.json +++ b/tests/translator/output/aws-us-gov/graphqlapi_function_use_resolver_code_settings.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/graphqlapi_ddb_datasource_all_properties.json b/tests/translator/output/graphqlapi_ddb_datasource_all_properties.json index 1d31ce406..5193e62b0 100644 --- a/tests/translator/output/graphqlapi_ddb_datasource_all_properties.json +++ b/tests/translator/output/graphqlapi_ddb_datasource_all_properties.json @@ -53,7 +53,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/graphqlapi_ddb_datasource_connector.json b/tests/translator/output/graphqlapi_ddb_datasource_connector.json index 3663a095e..a4fb431a4 100644 --- a/tests/translator/output/graphqlapi_ddb_datasource_connector.json +++ b/tests/translator/output/graphqlapi_ddb_datasource_connector.json @@ -53,7 +53,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSource": { + "SuperCoolAPIDynamoDBDataSourceAnotherDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ @@ -70,7 +70,7 @@ "Name": "AnotherDataSource", "ServiceRoleArn": { "Fn::GetAtt": [ - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole", + "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceRole", "Arn" ] }, @@ -78,7 +78,7 @@ }, "Type": "AWS::AppSync::DataSource" }, - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole": { + "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceRole": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -99,10 +99,10 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceToTableConnectorPolicy": { + "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceToTableConnectorPolicy": { "Metadata": { "aws:sam:connectors": { - "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceToTableConnector": { + "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceToTableConnector": { "Destination": { "Type": "AWS::DynamoDB::Table" }, @@ -165,13 +165,13 @@ }, "Roles": [ { - "Ref": "SuperCoolAPIDynamoDBDataSourcesAnotherDataSourceRole" + "Ref": "SuperCoolAPIDynamoDBDataSourceAnotherDataSourceRole" } ] }, "Type": "AWS::IAM::ManagedPolicy" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ @@ -188,7 +188,7 @@ "Name": "MyDataSource", "ServiceRoleArn": { "Fn::GetAtt": [ - "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole", + "SuperCoolAPIDynamoDBDataSourceMyDataSourceRole", "Arn" ] }, @@ -196,7 +196,7 @@ }, "Type": "AWS::AppSync::DataSource" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole": { + "SuperCoolAPIDynamoDBDataSourceMyDataSourceRole": { "Properties": { "AssumeRolePolicyDocument": { "Statement": [ @@ -217,10 +217,10 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSourceToTableConnectorPolicy": { + "SuperCoolAPIDynamoDBDataSourceMyDataSourceToTableConnectorPolicy": { "Metadata": { "aws:sam:connectors": { - "SuperCoolAPIDynamoDBDataSourcesMyDataSourceToTableConnector": { + "SuperCoolAPIDynamoDBDataSourceMyDataSourceToTableConnector": { "Destination": { "Type": "AWS::DynamoDB::Table" }, @@ -283,7 +283,7 @@ }, "Roles": [ { - "Ref": "SuperCoolAPIDynamoDBDataSourcesMyDataSourceRole" + "Ref": "SuperCoolAPIDynamoDBDataSourceMyDataSourceRole" } ] }, diff --git a/tests/translator/output/graphqlapi_function_datasource_property.json b/tests/translator/output/graphqlapi_function_datasource_property.json index 1958ea172..d8edfbe2e 100644 --- a/tests/translator/output/graphqlapi_function_datasource_property.json +++ b/tests/translator/output/graphqlapi_function_datasource_property.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/graphqlapi_function_overwrite_resolver_code_settings.json b/tests/translator/output/graphqlapi_function_overwrite_resolver_code_settings.json index 0a6e6c8e0..d1f973595 100644 --- a/tests/translator/output/graphqlapi_function_overwrite_resolver_code_settings.json +++ b/tests/translator/output/graphqlapi_function_overwrite_resolver_code_settings.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [ diff --git a/tests/translator/output/graphqlapi_function_use_resolver_code_settings.json b/tests/translator/output/graphqlapi_function_use_resolver_code_settings.json index 6bda9dff7..8a05b7a03 100644 --- a/tests/translator/output/graphqlapi_function_use_resolver_code_settings.json +++ b/tests/translator/output/graphqlapi_function_use_resolver_code_settings.json @@ -42,7 +42,7 @@ }, "Type": "AWS::IAM::Role" }, - "SuperCoolAPIDynamoDBDataSourcesMyDataSource": { + "SuperCoolAPIDynamoDBDataSourceMyDataSource": { "Properties": { "ApiId": { "Fn::GetAtt": [