aws-cloudformation / aws-cloudformation/cloudformation-coverage-roadmap

AWS::ApiGatewayV2::Api - GetAtt-Arn

Open
#294 4 comments 12 reactions 0 assignees View on GitHub
enhancement networking & content deliv
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.