Creating a stackset with cloudformation TO DEPLOY STACK IN MY MEMBERS ACCOUNT

0

Hello, Pls i need help with sample cloudformation code on how to deploy a stack set with cloudformation i keep getinng this error below, will really appreciate a correct code and the reason i was haveing error and what i was getting wrong

ERROR Properties validation failed for resource TestingStackSet20240411 with message: #: #: only 1 subschema matches out of 2 #/StackInstancesGroup/0: required key [DeploymentTargets] not found #/StackInstancesGroup/0: required key [Regions] not found #/StackInstancesGroup/0: extraneous key [StackInstances] is not permitted

CODE

  TestingStackSet20240411:
    Type: AWS::CloudFormation::StackSet
    Properties:
      StackSetName: TestingStackSet20240411
      TemplateURL: https://s3.amazonaws.com/<your-bucket>/StackSetTemplate.yaml
      Parameters:
      - {ParameterKey: BucketName, ParameterValue: TestingBucketName}
      # Tags: #[Array of Tag]
      Capabilities: #[Array of String]
      - CAPABILITY_NAMED_IAM
      PermissionModel: SELF_MANAGED #Allowed Values[SERVICE_MANAGED | SELF_MANAGED]
      AutoDeployment:
        # Describes whether StackSets automatically deploys to AWS Organizations accounts that are added to a target organizational unit
        Enabled: false
        RetainStacksOnAccountRemoval: false
      # StackInstancesGroup: #[Array of StackInstances]
      StackInstances:
      - DeploymentTargets:
          # AccountFilterType: #Allowed Values[NONE | UNION | INTERSECTION | DIFFERENCE]
          # OrganizationalUnitIds: #[Array of String]
          # AccountsUrl: [String]
          Accounts: #[Array of String]
          - !GetAtt TestingOUAccount20240411.AccountId #!RefTestingOUAccount20240411
          Regions: #[Array of String]
          - us-east-1
        ParameterOverrides: #[Array of Parameter]
        - {ParameterKey: BucketName, ParameterValue: TestingBucketName,}
Nafiu
질문됨 한 달 전227회 조회
1개 답변
2
수락된 답변

Hello.

I think the problem is that the list is created by listing something called "StackInstances" that cannot be used in "StackInstancesGroup".
Also, "Regions" was written to be included in "DeploymentTargets", so that has also been corrected.
So I think you can use it by modifying it as follows.
https://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-stackset.html#cfn-cloudformation-stackset-stackinstancesgroup

  TestingStackSet20240411:
    Type: AWS::CloudFormation::StackSet
    Properties:
      StackSetName: TestingStackSet20240411
      TemplateURL: https://s3.amazonaws.com/<your-bucket>/StackSetTemplate.yaml
      Parameters:
      - {ParameterKey: BucketName, ParameterValue: TestingBucketName}
      # Tags: #[Array of Tag]
      Capabilities: #[Array of String]
      - CAPABILITY_NAMED_IAM
      PermissionModel: SELF_MANAGED #Allowed Values[SERVICE_MANAGED | SELF_MANAGED]
      AutoDeployment:
        # Describes whether StackSets automatically deploys to AWS Organizations accounts that are added to a target organizational unit
        Enabled: false
        RetainStacksOnAccountRemoval: false
      StackInstancesGroup:
        - DeploymentTargets:
            # AccountFilterType: #Allowed Values[NONE | UNION | INTERSECTION | DIFFERENCE]
            # OrganizationalUnitIds: #[Array of String]
            # AccountsUrl: [String]
            Accounts: #[Array of String]
              - !GetAtt TestingOUAccount20240411.AccountId #!RefTestingOUAccount20240411
          Regions: 
            - us-east-1
        ParameterOverrides: #[Array of Parameter]
        - {ParameterKey: BucketName, ParameterValue: TestingBucketName,}
profile picture
전문가
답변함 한 달 전
profile picture
전문가
검토됨 6일 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠