CloudFormation堆栈集

时间:2020-06-12 21:56:34

标签: amazon-cloudformation

我正在编写一个Cloudformation模板,该模板将使用StackSets创建通用的SG和IAM角色。我将不得不引用VpcId作为模板的一部分。

Resources:
  StandardBaseSG:
    Type: 'AWS::EC2::SecurityGroup'
    Properties:
      GroupDescription: The standard security group applied to all EC2 resources with specific tags
      GroupName: STANDARD-BASE-SG
      VpcId: !FindInMap [VpcMap, !Ref "AWS::AccountId", VpcId]
      SecurityGroupIngress:
        - Description: SSH from your IP
          IpProtocol: tcp
          FromPort: '22'
          ToPort: '22'
          CidrIp: !Ref SSHRemoteAccessCIDR
        - Description: RDP from your IP
          IpProtocol: tcp
          FromPort: '3389'
          ToPort: '3389'
          CidrIp: !Ref RDPRemoteAccessCIDR
      Tags:
        - Key: Name
          Value: STANDARD-BASE-SG
        - Key: SharedSG
          Value: True

其他帐户中的VPCID引用无法像在StackSet中那样起作用。我无法使用AccountId和数字值进行映射。

有人可以在这种情况下帮助我吗?

0 个答案:

没有答案