aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap
AWS::ApiGatewayV2::Api - GetAtt-Arn
- Dominant language
- No language data
- Stars
- 1.1k
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
## Scope of request
`AWS::ApiGatewayV2::Api` does not support `GetAtt`.
## Expected behavior
It should be possible to use `GetAtt` with a `AWS::ApiGatewayV2::Api` to get the ARN of the resource, e.g. `!GetAtt MyApi.Arn`.
## Suggest specific test cases
```
Resources:
Api:
Type: AWS::ApiGatewayV2::Api
Properties:
Name: Lambda Proxy
Description: Lambda proxy using quick create
ProtocolType: HTTP
Target: !Ref Function # this resource has been omitted for brevity
ApiPermission:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:InvokeFunction
FunctionName: !GetAtt Function.Arn # this resource has been omitted for brevity
Principal: apigateway.amazonaws.com
SourceArn: !GetAtt Api.Arn # this does not work
```
## Category (required)
Networking & Content (API GW)
## Workaround
You can work around the issue with `!Ref`:
```
ApiPermission:
Type: AWS::Lambda::Permission
Properties:
Action: lambda:InvokeFunction
FunctionName: !GetAtt Function.Arn # this resource has been omitted for brevity
Principal: apigateway.amazonaws.com
SourceArn: !Sub 'arn:${AWS::Partition}:execute-api:${AWS::Region}:${AWS::AccountId}:${Api}/' # Api resource ommitted for brevity
```
Contributor guide
Assessment
This issue has not been assessed yet.