Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Stackset Resource #6

Merged
merged 20 commits into from
May 30, 2020
Merged

Conversation

xiwhuang
Copy link
Member

@xiwhuang xiwhuang commented Apr 22, 2020

Description of changes:

Added new resource AWS::CloudFormation::StackSet

Lastest Revision:

  • Refactored handler implementations using Call Chaining Pattern.
  • Deleted AwsCredentialsExtrator as it is no longer needed.
  • Updated to use GetTemplateSummary to validate template.

Testing

Unit Tests

  • 97% Instructions Cov.
  • 92% Branches Cov.

Manually tests

  • StackSet without StackInstances CREATE/DELETE/UPDATE
  • StackSet with StackInstances CREATE/DELETE/UPDATE
  • StackSet CREATE/DELETE/UPDATE with TemplateURL/TemplateBody
  • Negative Tests with Invalid Template
    • Unsupported regions
    • Embedded Stack/StackSet
    • Invalid TemplateURL/ TemplateBody
  • Template with Outputs

Known limitation

  • TemplateURL and OrganizationUnitIds can be not retrieve in READ/LIST handlers as StackSet API currently does not allow to do so.

Simple Working Template

Resources:
  MyStackSet:
    Type: AWS::CloudFormation::StackSet
    Properties:
      PermissionModel: SELF_MANAGED
      TemplateBody: |
        {
          "AWSTemplateFormatVersion": "2010-09-09",
          "Resources": {
            "IntegrationTestWaitHandle": {
              "Type": "AWS::CloudFormation::WaitConditionHandle",
              "Properties": {}
            }
          }
        }
      StackInstancesGroup: 
        - Regions:
            - us-east-1
            - us-west-2
          DeploymentTargets:
            Accounts:
              - 111111111111
      Tags:
        - Key: key1
          Value: value1
Outputs:
  StackSetId:
    Value: !Ref MyStackSet

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@xiwhuang xiwhuang requested a review from ammokhov April 22, 2020 02:03
@ammokhov ammokhov added the enhancement New feature or request label Apr 22, 2020
@xiwhuang xiwhuang marked this pull request as ready for review April 23, 2020 01:19
Copy link

@ammokhov ammokhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use call chaining pattern plz

@xiwhuang xiwhuang requested a review from ammokhov May 4, 2020 10:08
Copy link

@ammokhov ammokhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

progress chain looks good

@guanghug
Copy link

Reviewed the StackSets logics are fine.

Copy link

@wbingli wbingli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

final String templateLocation) {

final GetTemplateSummaryResponse response = proxyClient.injectCredentialsAndInvokeV2(
getTemplateSummaryRequest(templateBody, templateLocation),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIce!

@xiwhuang xiwhuang dismissed johnttompkins’s stale review May 30, 2020 00:54

Comments have been addressed

@xiwhuang xiwhuang merged commit 398c985 into aws-cloudformation:master May 30, 2020
"pattern": "^(ou-[a-z0-9]{4,32}-[a-z0-9]{8,32}|r-[a-z0-9]{4,32})$"
},
"Capability": {
"type": "string",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an array of the capabilities.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, capabilities should be an array. This is the Capability in definitions which will be referenced in Capabilities in properties.

@s0enke
Copy link

s0enke commented Jun 3, 2020

Great work! Is there a timeframe for bringing this to official CloudFormation (e.g. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/ReleaseHistory.html)?

@benbridts
Copy link

It might also be useful to change the state in the coverage roadmap:
aws-cloudformation/cloudformation-coverage-roadmap#102

Additionally is their work planned for having separate StackInstance resources? I can see value in being able to define the StackSet in one Stack and StackInstances in another (aws-cloudformation/cloudformation-coverage-roadmap#103).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.