aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.11k stars 54 forks source link

AWS::EFS::FileSystem - DNSName accesible via Fn::GetAtt #234

Open akunszt opened 4 years ago

akunszt commented 4 years ago

1. Title

AWS::EFS::FileSystem - DNSName accesible via Fn::GetAtt

2. Scope of request

Make the DNSName accessible using Fn::GetAtt on an AWS::EFS::FileSystem resource.

3. Expected behavior

Get back the DNS name created for the AWS::EFS::FileSystem resource, e.g. fs-XXXXX.efs.us-west-2.amazonaws.com

4. Suggest specific test cases

N/A

5. Helpful Links to speed up research and evaluation

N/A

6. Category

Storage

7. Any additional context

We want to mount EFS automatically in our EC2 instances, so we need to know how to access the it. The EFS file system (and a bunch of MountPoints but those are out of scope here) is created within the same stack. As we can't query the DNS name directly we have to use workarounds like this (it's a snippet from a LaunchTemplate, we're using tags to pass this information but the issue is the same if someone wants to put this into the UserData):

"TagSpecifications": [
  {
    "ResourceType": "instance",
    "Tags": [
      {
        "Key": "my_company:local:efs_server",
        "Value": {
          "Fn::Sub": [
             "${EFSServer}.efs.${AWS::Region}.amazonaws.com",
             { "EFSServer": { "Ref": "FileSystem" } }
          ],
        }
      }
    ]
  }
]

Instead of assembling the DNS name manually - and hoping that the generation method won't change without any notice - we would like to use something like this:

"TagSpecifications": [
  {
    "ResourceType": "instance",
    "Tags": [
      {
        "Key": "my_company:local:efs_server",
        "Value": { "Fn::GetAtt": [ "FileSystem", "DNSName" ] }
      }
    ]
  }
]
r-heimann commented 1 year ago

Related to https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/68