1

Ich habe eine Cloudformation Vorlage, die einen Opsworks-Stapel durch Hinzufügen weniger Ressourcen modifiziert.Regionaler Opsworks-Stapel kann nicht von Cloudformation gefunden werden

The Opsworks stack im Bereich eu-west-1 eingesetzt, die auch die API endpoint region ist, und es zeigt sich auf der Seite des Namens des Stapels: Regional.

Wenn ich laufen die Cloudformation template (Ich gebe die Stapel-ID als Parameter) bekomme ich diesen Fehler:

Unable to find stack with ID xxxxxxx

ich Cloudformation erraten kann nur die opsworks Ressourcen sehen, die in sind us-east-1 Region?

Ich habe versucht, die Region von Cloudformation zu ändern und die Vorlage bereitzustellen, aber der Stapel ist immer noch nicht gefunden.

Wie kann ich Cloudformation in allen Regionen nach dem Stack suchen lassen?

Sollte ich den Stapel opsworks klonen und den Endpunkt in die Region us-east-1 ändern?

Was wäre die beste Lösung?

Vorlage

{ 
    "AWSTemplateFormatVersion": "2010-09-09", 
    "Description": "Add a layer to an existing stack", 
    "Mappings": { 
    "Region2Principal": { 
     "eu-west-1": { 
     "EC2Principal": "ec2.amazonaws.com", 
     "OpsWorksPrincipal": "opsworks.amazonaws.com" 
     } 
    }, 
    }, 
    "Parameters": { 
    "Environment" : { 
     "Description": "The Environnement variable ", 
     "Type": "String", 
     "Default": "dev", 
     "AllowedValues" : ["test", "prod"] 
    }, 
    "InstanceType": { 
     "Type": "String", 
     "Default": "m4.large", 
     "AllowedValues" : ["t2.micro", "m1.small", "m1.large","m4.large","m4.xlarge","m4.2xlarge","m4.4xlarge","m4.10xlarge","m4.16xlarge","c4.large" , "c4.xlarge" ,"c4.2xlarge" , "c4.4xlarge","c4.8xlarge" , "c3.large" , "c3.xlarge", "c3.2xlarge", "c3.4xlarge" ,"c3.8xlarge"], 
     "ConstraintDescription": "must be a valid EC2 instance type" 
    }, 
    "StackID": { 
     "Type": "String", 
     "Description": "ID of the existing opsworks stack to edit" 
    }, 
    "vpcId": { 
     "Description": "VPC id of corresponding to the Environment", 
     "Type": "String" 
    }, 
    "subnetIds" :{ 
     "Description": "list of sunbnets in the chosen VPC", 
     "Type": "List<AWS::EC2::Subnet::Id>" 
    }, 
    "ScriptSG":{ 
     "Description": "script security group", 
     "Type" : "String" 
    }, 
    "SG": { 
     "Description": " layer security group", 
     "Type": "String" 
    } 
    }, 
    "Resources":{ 
    "Layer": { 
     "Type": "AWS::OpsWorks::Layer", 
     "Properties": { 
     "AutoAssignElasticIps" : false, 
     "AutoAssignPublicIps" : true 
     } 
    }, 
    "SInstance1": { 
     "Type": "AWS::OpsWorks::Instance", 
     "Properties": { 
     "Hostname": "S1", 
     "AutoScalingType": "timer", 
     "TimeBasedAutoScaling" : { 
      "Friday" : { "0" : "on", "6" : "on", "12" : "on", "18" : "on" }, 
      "Monday" : { "0" : "on", "6" : "on", "12" : "on", "18" : "on" } 
     }, 
     "RootDeviceType": "ebs", 
     "StackId": {"Ref": "StackID"}, 
     "LayerIds": [{"Ref": "Layer"}], 
     "InstanceType": {"Ref" : "InstanceType"} 
     } 
    }, 
    "Instance2": { 
     "Type": "AWS::OpsWorks::Instance", 
     "Properties": { 
     "Hostname": "S2", 
     "AutoScalingType": "timer", 
     "TimeBasedAutoScaling" : { 
      "Saturday": { "0" : "on", "6" : "on", "12" : "on", "18" : "on" }, 
      "Sunday" : { "0" : "on", "6" : "on", "12" : "on", "18" : "on" }, 
      "Thursday": { "0" : "on", "6" : "on", "12" : "on", "18" : "on" }, 
      "Tuesday" : { "0" : "on", "6" : "on", "12" : "on", "18" : "on" }, 
      "Wednesday":{ "0" : "on", "6" : "on", "12" : "on", "18" : "on" } 
     }, 
     "RootDeviceType": "ebs", 
     "StackId": {"Ref": "StackID"}, 
     "LayerIds": [{"Ref": "Layer"}], 
     "InstanceType": {"Ref" : "InstanceType"} 
     } 
    }, 
    "ELB": { 
     "Type": "AWS::ElasticLoadBalancing::LoadBalancer", 
     "Properties": { 
     "ConnectionDrainingPolicy" : { 
      "Enabled" : true, 
      "Timeout" : 300 
     }, 
     "ConnectionSettings" : { 
      "IdleTimeout" : 60 
     }, 
     "CrossZone" : true, 
     "HealthCheck" : { 
      "HealthyThreshold" : "3", 
      "Interval" : "30", 
      "Target" : "HTTP:80/ping", 
      "Timeout" : "5", 
      "UnhealthyThreshold" : "2" 
     }, 
     "LoadBalancerName": "loadBalancer", 
     "Listeners" : [{ 
      "InstancePort" : "80", 
      "InstanceProtocol" : "HTTP", 
      "LoadBalancerPort" : "80", 
      "Protocol" : "HTTP" 
     }], 
     "Scheme" : "internal", 
     "SecurityGroups" : [{ "Ref" : "ELBSecurityGroup" }], 
     "Subnets" : { "Ref" : "subnetIds"} 
     } 
    }, 
    "ELBAttach":{ 
     "Type": "AWS::OpsWorks::ElasticLoadBalancerAttachment", 
     "Properties": { 
     "ElasticLoadBalancerName" : {"Ref" : "ELB"}, 
     "LayerId" : {"Ref" : "Layer" } 
     } 
    } 
    }, 
} 

Antwort

0

Es sieht aus wie Sie sie in der gleichen Region bewegen müssen.

Resources can be managed only in the region in which they are created. Resources that are created in one regional endpoint are not available, nor can they be cloned to, another regional endpoint.

http://docs.aws.amazon.com/general/latest/gr/rande.html#opsworks_region

https://aws.amazon.com/about-aws/whats-new/2016/08/aws-opsworks-adds-nine-regional-endpoints-and-asia-pacific-seoul-region-support/

Schicht ist die stackID Parameter fehlt.

{ 
"Type": "AWS::OpsWorks::Layer", 
"Properties": { 
"Attributes" : { String:String }, 
"AutoAssignElasticIps" : Boolean, 
"AutoAssignPublicIps" : Boolean, 
"CustomInstanceProfileArn" : String, 
"CustomJson" : JSON object, 
"CustomRecipes" : Recipes, 
"CustomSecurityGroupIds" : [ String, ... ], 
"EnableAutoHealing" : Boolean, 
"InstallUpdatesOnBoot" : Boolean, 
"LifecycleEventConfiguration" :     LifeCycleEventConfiguration, 
"LoadBasedAutoScaling" : LoadBasedAutoScaling, 
"Name" : String, 
"Packages" : [ String, ... ], 
"Shortname" : String, 
"StackId" : String, 
"Type" : String, 
"VolumeConfigurations" : [ VolumeConfiguration, ... ] 
} 
    } 

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-opsworks-layer.html

+0

Meine Standardregion ist 'eu-west-1 'und Cloudformation-Stack ist in' eu-west-1' und gleiche wie die opsworks Endpunkt ist es 'eu-west-1 '. Sie befinden sich alle in derselben Region, aber die Cloud-Informationen können die Ressourcen von opsworks nicht finden. – Somar

+0

Können Sie Ihre Cloud-Informationen posten? – strongjz

+0

erledigt, die Frage ist bearbeitet – Somar

Verwandte Themen