gpt4 book ai didi

amazon-web-services - ID 为 X 的堆栈不存在或已被删除 - cfn-init

转载 作者:行者123 更新时间:2023-12-02 04:08:28 25 4
gpt4 key购买 nike

我正在尝试创建一个 CloudFormation 堆栈,但得到:

Stack with id airflow-layer does not exist or has been deleted

气流层是我正在创建的云形成堆栈的名称。自动引用我正在创建的堆栈的正确方法是什么?

{
"Description": "AWS CloudFormation to airflow",
"Resources": {
"AirflowEC2": {
"Metadata": {
"AWS::CloudFormation::Init": {
"configSets": {
"install_airflow": [
"install_airflow"
]
},
"install_airflow": {
"commands": {
"test": {
"command": "echo Ola mundo"
}
}
}
}
},
"Properties": {
"ImageId": "ami-9abea4fb",
"InstanceType": "t2.micro",
"KeyName": "CLOUD_ADMIN",
"SecurityGroupIds": [
"sg-03851765"
],
"SubnetId": "subnet-0820796d",
"Tags": [
{
"Key": "Name",
"Value": "ec2-airflow-production"
}
],
"UserData": {
"Fn::Base64": {
"Fn::Join": [
"",
[
"#!/bin/bash -xe\n",
"sudo apt-get update\n",
"sudo apt-get -y install python-setuptools\n",
"sudo apt-get -y install python-pip\n",
"sudo pip install https://s3.amazonaws.com/cloudformation-examples/aws-cfn-bootstrap-latest.tar.gz\n",
"cfn-init -s '",
{
"Ref": "AWS::StackName"
},
"' -r AirflowEC2 -c install_airflow"
]
]
}
}
},
"Type": "AWS::EC2::Instance"
},
"AirflowElasticIP": {
"Properties": {
"AllocationId": "eipalloc-7214ae17",
"InstanceId": {
"Ref": "AirflowEC2"
}
},
"Type": "AWS::EC2::EIPAssociation"
}
}
}

最佳答案

当我在没有“--region”的情况下运行“cfn-init”时,出现此错误。包含它可以解决问题。

关于amazon-web-services - ID 为 X 的堆栈不存在或已被删除 - cfn-init,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38150954/

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