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

AWS::EC2::TrafficMirrorTarget - Arn accessible via Fn::GetAtt #261

Open
akunszt opened this issue Nov 15, 2019 · 2 comments
Open

AWS::EC2::TrafficMirrorTarget - Arn accessible via Fn::GetAtt #261

akunszt opened this issue Nov 15, 2019 · 2 comments
Labels
compute EC2, ECR, ECS, EKS, Lambda, Batch, Elastic Beanstalk, Serverless Application Repository enhancement New feature or request

Comments

@akunszt
Copy link

akunszt commented Nov 15, 2019

1. Title

AWS::EC2::TrafficMirrorTarget - Arn accessible via Fn::GetAtt

2. Scope of request

We want to share a TrafficMirrorTarget between our accounts. The AWS::RAM::ResourceShare accepts only ARNs so we have to assemble the ARN of the TrafficMirrorTarget manually (and hoping that the template won't change without any notice in the future).
It's a snippet from an AWS::RAM::ResourceShare resource.

"ResourceArns": [
  {
    "Fn::Sub": [
      "arn:aws:ec2:${AWS::Region}:${AWS::AccountId}:traffic-mirror-target/${MirrorTargetId}",
      { "MirrorTargetId": { "Ref": "MirrorTarget" } }
    ]
  }
]

It would be much more easier - and future proof - if we can fetch the ARN directly.

"ResourceArns": [
  { "Fn::GetAtt": [ "MirrorTarget", "Arn" ] }
]

3. Expected behavior

Get back the ARN.

4. Suggest specific test cases

N/A

5. Helpful Links to speed up research and evaluation

N/A

6. Category

Networking

7. Any additional context

N/A

@TheDanBlanco TheDanBlanco added compute EC2, ECR, ECS, EKS, Lambda, Batch, Elastic Beanstalk, Serverless Application Repository enhancement New feature or request labels Nov 26, 2019
@PatMyron
Copy link
Contributor

PatMyron commented Dec 18, 2019

@akunszt good work on the workaround. One way to future proof it a bit more is the usage of the AWS::Partition pseudoparameter as described in:
#68 (comment)
https://stackoverflow.com/a/59362496/4122849

      "arn:${AWS::Partition}:ec2:${AWS::Region}:${AWS::AccountId}:traffic-mirror-target/${MirrorTargetId}",

@WaelA WaelA changed the title AWS::EC2::TrafficMirrorTarget-Arn accessible via Fn::GetAtt AWS::EC2::TrafficMirrorTarget - Arn accessible via Fn::GetAtt Aug 4, 2021
@phil-lavin
Copy link

+1 for ARN being available via Fn::GetAtt

Thanks for the workaround - I had figured the solution was something like this but TMTs don't seem to openly advertise their ARN in AWS console or CLI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compute EC2, ECR, ECS, EKS, Lambda, Batch, Elastic Beanstalk, Serverless Application Repository enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants