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: SAM spec type is wrong for Serverless Function Policies #636

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

rix0rrr
Copy link
Contributor

@rix0rrr rix0rrr commented Oct 24, 2023

The apparent contract we didn't implement correctly was that the fields named Inclusive*ItemTypes need to be respected, regardless of whether the top-level type includes List or not.

So force that behavior.

The apparent contract we didn't implement correctly was that the
fields named `Inclusive*ItemTypes` need to be respected, regardless
of whether the top-level type includes `List` or not.

So force that behavior.
@rix0rrr rix0rrr requested a review from a team October 24, 2023 23:55
@github-actions
Copy link

@aws-cdk/aws-service-spec: Model database diff detected

└[~] service aws-sam
  └ resources
     ├[~] resource AWS::Serverless::Function
     │ ├ properties
     │ │  └ Policies: - string | Array<string | IAMPolicyDocument | SAMPolicyTemplate> | IAMPolicyDocument ⇐ string | IAMPolicyDocument (immutable)
     │ │              + string | IAMPolicyDocument | Array<string | IAMPolicyDocument | SAMPolicyTemplate> (immutable)
     │ └ types
     │    ├[~] type BucketSAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type CollectionSAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type DomainSAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type EmptySAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type FunctionSAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type IdentitySAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type KeySAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type LogGroupSAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type ParameterNameSAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type QueueSAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type SAMPolicyTemplate
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type SecretArnSAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type StateMachineSAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type StreamSAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type TableSAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    ├[~] type TableStreamSAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined
     │    └[~] type TopicSAMPT
     │      └  - mustRenderForBwCompat: true
     │         + mustRenderForBwCompat: undefined
     └[~] resource AWS::Serverless::StateMachine
       ├ properties
       │  └ Policies: - string | Array<string | IAMPolicyDocument | SAMPolicyTemplate> | IAMPolicyDocument ⇐ string | IAMPolicyDocument (immutable)
       │              + string | IAMPolicyDocument | Array<string | IAMPolicyDocument | SAMPolicyTemplate> (immutable)
       └ types
          ├[~] type FunctionSAMPT
          │ └  - mustRenderForBwCompat: true
          │    + mustRenderForBwCompat: undefined
          ├[~] type SAMPolicyTemplate
          │ └  - mustRenderForBwCompat: true
          │    + mustRenderForBwCompat: undefined
          └[~] type StateMachineSAMPT
            └  - mustRenderForBwCompat: true
               + mustRenderForBwCompat: undefined

@mrgrain
Copy link
Contributor

mrgrain commented Oct 25, 2023

@rix0rrr Thanks! Was this change expected?

     │    ├[~] type BucketSAMPT
     │    │ └  - mustRenderForBwCompat: true
     │    │    + mustRenderForBwCompat: undefined

@rix0rrr
Copy link
Contributor Author

rix0rrr commented Oct 25, 2023

I guess so?

It must be because those types are now used.

@aws-cdk-automation aws-cdk-automation added this pull request to the merge queue Oct 25, 2023
Merged via the queue into main with commit b0717b8 Oct 25, 2023
9 checks passed
@aws-cdk-automation aws-cdk-automation deleted the huijbers/fix-inclusivetypes branch October 25, 2023 15:17
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.

3 participants