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
gefragt vor einem Monat227 Aufrufe
1 Antwort
2
Akzeptierte Antwort

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
EXPERTE
beantwortet vor einem Monat
profile picture
EXPERTE
überprüft vor 6 Tagen
profile picture
EXPERTE
überprüft vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen