aws-cloudformation / cloudformation-cli

The CloudFormation Provider Development Toolkit allows you to author your own resource providers and modules that can be used by CloudFormation.
Apache License 2.0
316 stars 158 forks source link

Execution role is missing `cloudformation:ListExports` #941

Open ericzbeard opened 1 year ago

ericzbeard commented 1 year ago

When running cfn generate, resource-role.yaml is created based on the roles required in the resource schema. If the user provides inputs for testing and includes a template variable in the inputs, test-type fails.

botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the ListExports operation: 
User: arn:aws:sts::755952356119:assumed-role/awscommunity-s3-deletebucketcontents-ExecutionRole-AJU1L19ZAMNZ/CloudFormationContractTest-20221112002935 
is not authorized to perform: cloudformation:ListExports because no identity-based policy allows the cloudformation:ListExports action

The workaround is to manually edit resource-role.yaml to add the missing action.