SimpleAD and CDK: How to reference IP addresses?

0

A SimpleAD has two IP addresses. We want to set up two A-records in a hosted zone that point to those IP addresses.

In the A-record code we tried this (simpleAD is the constructed SimpleAD):

target: route53.RecordTarget.fromIpAddresses(simpleAd.attrDnsIpAddresses[0], simpleAd.attrDnsIpAddresses[1]),

.. but got "Error: Resolution error: Resolution error: Cannot add elements to list token, got: #{Token[TOKEN.163]},.."

We tried adding a dependency (aRecord is the constructed A-record):

aRecord.node.addDependency(simpleAd) ;

... but no change.

So how do we refer to those addresses in a way that lets them be used in the A-record construction?

Any ideas gratefully accepted.

Regards, K.

kauer
질문됨 3년 전334회 조회
1개 답변
0

With the help of this post:

https://github.com/aws/aws-cdk/issues/6475

I ended up with this (working) solution:

  target: route53.RecordTarget.fromIpAddresses(  
    cdk.Fn.select(0, simpleAd.attrDnsIpAddresses),  
    cdk.Fn.select(1, simpleAd.attrDnsIpAddresses),  
  ),  

Thanks, K.

kauer
답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠