AWS Cloudformation GetAtt Managed AD DNS IPアドレス 取得

 ・Managed ADのDNS IPアドレスをGetAttで取得する。


・Managed AD作成例

  TestDirectory:

    Type: AWS::DirectoryService::MicrosoftAD

    Properties:

      Edition: Standard

      Name: example.com

      Password: !Ref DirectoryPassword

      VpcSettings:

        SubnetIds:

          - !Ref PublicSubnet0

          - !Ref PublicSubnet1

        VpcId:

          !Ref Vpc


・GetAttで取得

★GetAttで取得できる情報は以下URLに記載。

★Typeでぐぐるとヒットする(今回だと AWS::DirectoryService::MicrosoftAD)

AWS::DirectoryService::MicrosoftAD


・DNSは配列

・引用(上記URLより)

DnsIpAddresses

The IP addresses of the DNS servers for the directory, such as [ "192.0.2.1", "192.0.2.2" ].


DNSs: !GetAtt TestDirectory.DnsIpAddresses


・一つずつ取得するには Selectと組み合わせる。

DNS1: !Select [0, !GetAtt TestDirectory.DnsIpAddresses]

DNS2: !Select [1, !GetAtt TestDirectory.DnsIpAddresses]

コメント

このブログの人気の投稿

AWS Cloudformation ImportValue Sub 併用