项目作者: concon121

项目描述 :
AWS Service Catalog Product management centred around facilitating CI Pipelines
高级语言: Python
项目地址: git://github.com/concon121/aws-conduit.git
创建时间: 2017-11-18T23:02:08Z
项目社区:https://github.com/concon121/aws-conduit

开源协议:MIT License

下载


AWS Conduit

Product management for AWS Service Catalog.

Installation

AWS Conduit is available to install via pip.

  1. pip install aws_conduit

Usage

  1. > conduit ?
  2. Usage:
  3. conduit COMMAND [ARGS...]
  4. conduit help [COMMAND]
  5. Options:
  6. -h, --help show this help message and exit
  7. Commands:
  8. build Release a build from a conduitspec.yaml
  9. help (?) give detailed help on a specific sub-command
  10. portfolio Portfolio management for the masses!
  11. product Product management for the masses!
  12. provision Provision a product from a conduitspec.yaml
  13. start Set up the initial Conduit resources.
  14. support Set the default support configuration.
  15. terminate Terminate a product from a conduitspec.yaml

Tutorial

Initial Setup

AWS conduit needs to set up some intial resources to get started.

Whats in the box?

  • An S3 bucket which is used to store configuration and cloudformation resources. This bucket will be named conduit-config-${AWS::AccountId}.
  • An IAM role which deployments happen through. This will be named conduit-provisioner-role.
  • An IAM policy which custom deploy profiles are added to. This will be named conduit-policy.
  1. > conduit start

Support Details

Service Catalog products can have support information assigned to them. This is so that if anything goes wrong with your products, your users know how to contact you!

  1. > conduit support -e "noone@home.com" -u "http://madeup.com" -d "This is the groovy support info"

Creating a new Portfolio

You’ll want to create a new portfolio before you start adding new products. A portfolio is a collection of products that can be shared with other users and other AWS accounts.

  1. > conduit portfolio create -n "My Portfolio" -d "This is my portfolio description"

Creating a new Product

When you have a portfolio in place, start adding new products to it!

  1. > conduit product create -n "My Product" -d "this is my product info" -c "yaml" -p "My Portfolio"

The conduitspec.yaml

The aim of this file is to behave as a descriptor of your product, facilitating automation of builds and deployments by proving Conduit with an appropriate set of metadata.

Example coduitspec.yaml

  1. portfolio: "test-portfolio" # The name of the portfolio this product belongs to.
  2. product: "groovy-test-product" # The name of this product.
  3. cfn: # Cloudformation information
  4. template: "TestProduct.yaml" # The location of the cloudformation template relative to the current directory.
  5. type: "yaml" # yaml or json
  6. deployProfile: # Custom IAM policy which describes the actions are resources involved
  7. - actions: # in deployment of your product.
  8. - "s3:*"
  9. resources:
  10. - "*"

CI Build Increments

When using a conduitspec.yaml, product changes can be published via semantic versioning of your release artifacts.

The build command will create a new artifact version in Service Catalog, of the product defined by the conduitspec.yaml.

  1. # Starting on version 0.0.0
  2. > conduit build # 0.0.0+build1
  3. > conduit build # 0.0.0+build2
  4. > conduit build # 0.0.0+build3
  5. > conduit build patch # 0.0.1
  6. > conduit build patch # 0.0.2
  7. > conduit build # 0.0.2+build1
  8. > conduit build minor # 0.1.0
  9. > conduit build major # 1.0.0

Build versions (+build…) are considered to be temporary. Upon release of a major / minior / patch version, all build versions that are lower than the new version are removed from Service Catalog, so your product version history is kept nice and tidy!

Provisioning

When using a conduitspec.yaml, you can provision and terminate your product on the cli, all you need to do is provide a name for the provisioned product. In a CI environment, it is recommended that the name you provide reflects the environment you are deploying to.

NOTE: At the time of writing, stack parameters are input on the command line. This is not particularly automation friendly and will be improved in the near future.

Example Provisioner

  1. > conduit provision -n test-product-dev
  2. Account Id: 12345678910
  3. Ensuring Conduit is up to date...
  4. Associating conduit with test-portfolio
  5. Associating conduit with example-port
  6. Provisioning product...
  7. Getting launch path...
  8. Getting input parameters...
  9. Hello (Default: World!): yolo!
  10. Assumiing conduit IAM role...
  11. Provisioning now...
  12. Provision Success!

Example Terminator

  1. conduit terminate -n test-product-dev
  2. Account Id: 12345678910
  3. Ensuring Conduit is up to date...
  4. Associating conduit with test-portfolio
  5. Associating conduit with example-port
  6. Terminating product...
  7. Assumiing consuit IAM role...
  8. Terminating now...
  9. Terminate complete!

Example Updater

If you release a new version of a product after provisioning it, re-provisioning will automatically perform an update for you.

  1. > conduit provision -n test-product-dev
  2. Account Id: 12345678910
  3. Ensuring Conduit is up to date...
  4. Associating conduit with test-portfolio
  5. Associating conduit with example-port
  6. Provisioning product...
  7. Getting launch path...
  8. Getting input parameters...
  9. Hello (Default: World!): yolo!
  10. Assumiing conduit IAM role...
  11. Updating now...
  12. Update Success!

Utility Commands

List all Portfolios

  1. > conduit portfolio list
  2. Name Id Description
  3. ------------------------------------------------------------------------------------------
  4. test-portfolio port-c3ghpcitagt2w test portfolio description
  5. another-portfolio port-dfh2m6vzbwweu groovy portfolio

List all products

  1. > conduit product list
  2. Name Id Description
  3. ------------------------------------------------------------------------------------------
  4. groovy-test-product prod-wkc4otel6chxu Groovy products are groovy
  5. another-test-product prod-craeqnatjljsc Another test product

Best Practices

  • conduitspec.yaml is king! Yes, you can do stuff without it, but life will be easier if you embrace it.