小编ng1*_*404的帖子

无法使用CloudFormation删除Amazon ECS集群

我正在使用以下CloudFormation模板创建ECS集群。

AWSTemplateFormatVersion: '2010-09-09'
Description: 'AWS Cloudformation Template to create the Infrastructure'
Resources:
  ECSCluster:
    Type: AWS::ECS::Cluster
    Properties:
    ClusterName: 'Blog-iac-test-1'
  EC2InstanceProfile:
    Type: AWS::IAM::InstanceProfile
    Properties:
    Path: /
    Roles: [!Ref 'EC2Role']
  ECSAutoScalingGroup:
    Type: AWS::AutoScaling::AutoScalingGroup
  Properties:
    VPCZoneIdentifier:
    - subnet-****
    LaunchConfigurationName: !Ref 'ECSAutoscalingLC'
    MinSize: '1'
    MaxSize: '2'
    DesiredCapacity: '1'
 ECSAutoscalingLC:
    Type: AWS::AutoScaling::LaunchConfiguration
    Properties:
      AssociatePublicIpAddress: true
      ImageId: 'ami-b743bed1'
      SecurityGroups:
      - sg-****
      InstanceType: 't2.micro'
      IamInstanceProfile: !Ref 'EC2InstanceProfile'
      KeyName: 'test'
      UserData:
        Fn::Base64: !Sub |
        #!/bin/bash -xe
        echo ECS_CLUSTER=Blog-iac-test-1 >> /etc/ecs/ecs.config
  EC2Role:
    Type: AWS::IAM::Role
    Properties:
      AssumeRolePolicyDocument:
      Statement:
      - Effect: Allow …
Run Code Online (Sandbox Code Playgroud)

aws-cloudformation

6
推荐指数
1
解决办法
668
查看次数

标签 统计

aws-cloudformation ×1