Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

fix: Connector "Type" cannot be Serverless resource types #3088

Merged
merged 4 commits into from
Apr 5, 2023

Conversation

GavinZZ
Copy link
Contributor

@GavinZZ GavinZZ commented Apr 5, 2023

Issue #, if available

Description of changes

There is a connector bug when using RoleName + Type.

MyReadConnector:
    Type: AWS::Serverless::Connector
    Properties:
      Source:
        Type: AWS::Serverless::Function
        RoleName: MyRole
      Destination:
        Id: MyTable
      Permissions:
      - Read

Because we didn't input Id, it will directly use Type and try to find a profile using AWS::Serverless::Function to AWS::DynamoDB::Table. It will fail because not such profile is found. We should be using AWS::lambda::Function instead.

Description of how you validated changes

Added tests

Checklist

Examples?

Please reach out in the comments if you want to add an example. Examples will be
added to sam init through aws/aws-sam-cli-app-templates.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@GavinZZ GavinZZ marked this pull request as ready for review April 5, 2023 21:33
@GavinZZ GavinZZ requested a review from a team as a code owner April 5, 2023 21:33
@GavinZZ GavinZZ changed the title fix: Get CFN resource type from SAM resource type fix: Connector "Type" cannot be Serverless resource types Apr 5, 2023
samtranslator/model/connector/connector.py Outdated Show resolved Hide resolved
samtranslator/model/connector/connector.py Outdated Show resolved Hide resolved
@aahung aahung enabled auto-merge (squash) April 5, 2023 22:06
@aahung aahung merged commit 675381a into aws:develop Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants