gpt4 book ai didi

amazon-web-services - 在 aws cloudformation 期间未找到资源的属性 publicip

转载 作者:行者123 更新时间:2023-12-04 14:55:35 25 4
gpt4 key购买 nike

我对 aws cloudformation 非常陌生,我尝试在私有(private) VPC 中启动安装了 Neo4j 的 EC2,我发现有人已经使用 Neo4j 创建了一个 cloudformation 模板,但该实例适用于公共(public) VPC,所以我修改了模板以适合我的目的,但是当我启动它时遇到了这个问题:“找不到资源的属性 publicip”

以下是脚本的一部分(没有 neo4j bash 脚本和 EBS 卷设置):

"Mappings" : {

"AWSRegionArch2AMI" : {
"eu-west-1" : { "64" : "ami-58d7e821" }
}

},

"Parameters": {
"InstanceType" : {
"Description" : "EC2 instance type",
"Type" : "String",
"Default" : "m5.large",
"ConstraintDescription" : "Must be a valid EC2 instance type."
},

"SSHKeyName": {
"Description": "Name of the SSH key that you will use to access the server (must be on AWS Availability Zone already)",
"Type": "String"
},

"NetworkWhitelist": {
"Description": " The IP address range that can be used to connect to the Neo4j server (by REST or SSH)",
"Type": "String",
"MinLength": "9",
"MaxLength": "18",
"Default": "",
"AllowedPattern": "(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})/(\\d{1,2})",
"ConstraintDescription": "must be a valid IP CIDR range of the form x.x.x.x/x."
},

"SubnetId" : {
"Type" : "AWS::EC2::Subnet::Id",
"Description" : "SubnetId of an existing subnet (for the primary network) in your Virtual Private Cloud (VPC)"
},

"SecurityGroupIds": {
"Type": "AWS::EC2::SecurityGroup::Id",
"Description" : "Existing SecurityGroups ID"
},

"AvailabilityZone": {
"Type" : "AWS::EC2::AvailabilityZone::Name",
"Description" : "Select the Availability Zone"
}

},
"Resources": {
"Server": {
"Type": "AWS::EC2::Instance",
"Properties": {
"AvailabilityZone": {
"Ref": "AvailabilityZone"
},


"DisableApiTermination": "FALSE",
"ImageId": {
"Fn::FindInMap": [ "AWSRegionArch2AMI", {
"Ref": "AWS::Region"
}, "64"]
},
"InstanceType": {
"Ref": "InstanceType"
},
"KeyName": {"Ref": "SSHKeyName"},
"Monitoring": "false",
"NetworkInterfaces" : [
{
"AssociatePublicIpAddress": false,
"DeleteOnTermination": true,
"DeviceIndex": "0",
"SubnetId": {"Ref": "SubnetId"},
"GroupSet": [ {"Ref": "SecurityGroupIds"} ]
}
],

我不能像“启动实例向导”中的“配置实例详细信息”一样启动没有公共(public) IP 地址的实例吗?

谢谢

最佳答案

您是否为您尝试在其中创建实例的子网启用了“自动分配公共(public) IP”选项?由于您明确未关联公共(public) IP 地址,因此可能会失败,因为资源期望分配公共(public) IP 地址。测试这一点的可靠方法是将 SubnetId 参数设置为子网的 ID,该子网在部署堆栈时不会自动分配公共(public) IP 地址。

关于amazon-web-services - 在 aws cloudformation 期间未找到资源的属性 publicip,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50640788/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com