我正在使用CloudFormation创建一个EC2实例。我想要实现的只是分配一个公网IP。没有内网IP。一切都创建得很好,它为公共IP创建了一个DNS条目,但它也创建了一个私有IP。我怎么告诉它不要创建内网IP。这是我的模板:
Resources:
EC2Instance:
Properties:
ImageId:
Ref: ImageId
InstanceType:
Ref: InstanceType
KeyName:
Ref: KeyName
NetworkInterfaces:
- GroupSet:
- Ref: GroupId
DeviceIndex: 0
DeleteOnTermination: true
SubnetId:
Ref: SubnetId
Type: AWS::EC2::Instance
DnsRecord:
Type: AWS::Route53::RecordSet
Properties:
HostedZoneName: !Ref 'HostedZoneName'
Comment: DNS name for my instance.
Name: !Join ['', [!Ref 'Subdomain', ., !Ref 'HostedZoneName']]
Type: A
TTL: '300'
ResourceRecords:
- !GetAtt EC2Instance.PublicIp发布于 2018-08-29 22:28:40
您始终拥有内网IP。你这方面有什么问题吗?
https://stackoverflow.com/questions/52075377
复制相似问题