I’m trying to attach the CloudFormationDescribeStacksPolicy to a Lambda in my SAM template file like so,
<code> getEnvironment:
Type: AWS::Serverless::Function
DependsOn: AppTable
Properties:
Handler: src/getEnvironment.handler
Description: Get environment details
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref AppTable
- CloudFormationDescribeStacksPolicy
Events:
ClientApi:
Type: Api
Properties:
RestApiId: !Ref ClientApi
Path: /environment
Method: GET
</code>
<code> getEnvironment:
Type: AWS::Serverless::Function
DependsOn: AppTable
Properties:
Handler: src/getEnvironment.handler
Description: Get environment details
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref AppTable
- CloudFormationDescribeStacksPolicy
Events:
ClientApi:
Type: Api
Properties:
RestApiId: !Ref ClientApi
Path: /environment
Method: GET
</code>
getEnvironment:
Type: AWS::Serverless::Function
DependsOn: AppTable
Properties:
Handler: src/getEnvironment.handler
Description: Get environment details
Policies:
- DynamoDBCrudPolicy:
TableName: !Ref AppTable
- CloudFormationDescribeStacksPolicy
Events:
ClientApi:
Type: Api
Properties:
RestApiId: !Ref ClientApi
Path: /environment
Method: GET
But the CloudFormation deployment fails with,
<code>CREATE_IN_PROGRESS AWS::IAM::Role getEnvironmentRole ARN CloudFormationDesc
ribeStacksPolicy is
not valid. (Service:
Iam, Status Code: 400,
Request ID:
</code>
<code>CREATE_IN_PROGRESS AWS::IAM::Role getEnvironmentRole ARN CloudFormationDesc
ribeStacksPolicy is
not valid. (Service:
Iam, Status Code: 400,
Request ID:
</code>
CREATE_IN_PROGRESS AWS::IAM::Role getEnvironmentRole ARN CloudFormationDesc
ribeStacksPolicy is
not valid. (Service:
Iam, Status Code: 400,
Request ID:
Any idea what the issue might be here?