Code Monkey home page Code Monkey logo

aws-cloudformation-stack-instances's Introduction

repository moved, maintained elsewhere -> https://github.com/curlim/aws-cloudformation-stack-instances

Concurrent AWS CloudFormation Stack Instance Resource Provider Type

This repository implements an AWS CloudFormation Resource Provider, which concurrently creates stack instances within a particular AWS Cloudformation StackSet.

ProServe::Cloudformation::StackInstances

See example usage of the resource below. Detailed documentation can be found in the /docs folder.

Cloudformation itself has not yet the capability to run operations concurrent on StackSets. This resource helps to overcome this by implementing a retry mechanism. Whenever an operation is already ongoing on the same Stackset, the resource provider takes care of retrying with proper backoff configurations.

Hence, this resource can be used to meet requirements from different use cases without taking care of currently running operations.

Usage

InstanceC:
  Type: ProServe::Cloudformation::StackInstances
  Properties:
    StackSetName: test
    StackInstances:
      DeploymentTargets:
        Accounts:
        - '123456789012'
        - '123456789013'
      Regions:
      - eu-west-1
      - us-east-1
    OperationPreferences:
      FailureToleranceCount: 0
      MaxConcurrentCount: 1
      RegionConcurrencyType: PARALLEL
    Capabilities:
    - CAPABILITY_IAM

Typical Use Cases

AWS Account Vending process integrated in AWS Service Catalog

This resource provider can be used within an Account Blueprint published via AWS Service Catalog Products. In case multiple accounts are requested at once, the resource provider takes care handling the concurrency.

AWS Service Catalog Products

Any generic AWS Service Catalog Product might have a pre-requisite to enroll a region or account into a central CloudFormation Stackset. Multiple users might launch a product at once, which can result in operation conflicts on CloudFormation StackSets. This resource can be integrated in any product template and takes care of concurrency.

Quickstart

You can use the following link to deploy the CloudFormation resource provider directly into your AWS account. Ensure you are logged into the AWS Console before following it. After following the link, ensure you picked the desired Region on the top right within the AWS Console.

Quickstart CloudFormation Link

Manual Deployment

For manual deployments check the cfn-provider-registration.yaml CloudFormation template.

Development

Please refer to the AWS CloudFormation CLI documentation https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-types.html.

Pre-requisites

Build

  • mvn package to build sources
  • cfn submit --region <aws-region> --dry-run for a dry-run
  • cfn submit --region <aws-region> to finally submit the resource provider to AWS CloudFormation

Future Work

  • Add the option to specify multiple deployment targets with different parameter overrides.

Notes

  • While code samples in this repository has been tested and believe it works well, as always, be sure to test it in your environment before using it in production!

Read and List operations implementations do not meet the contract test requirements. This is on purpose, as deleting twice or creating of stack instances multiple times does create any drift and still ensures proper state handling. Additionally, adoption of this AWS CloudFormation resource provider is very straight forward this way. Instances do not have to be deleted first and re-created with this resource.

The RPDK will automatically generate the correct resource model from the schema whenever the project is built via Maven. You can also do this manually with the following command: cfn generate.

Please don't modify files under target/generated-sources/rpdk, as they will be automatically overwritten.

The code uses Lombok, and you may have to install IDE integrations to enable auto-complete for Lombok-annotated classes.

Security

See CONTRIBUTING for more information.

License

This project is licensed under the MIT-0 License.

aws-cloudformation-stack-instances's People

Contributors

amazon-auto avatar f7o avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

curlim

aws-cloudformation-stack-instances's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.