aws-cfn-control


Nameaws-cfn-control JSON
Version 1.0.12 PyPI version JSON
download
home_pagehttps://github.com/awslabs/aws-cfn-control
SummaryCommand line launch and management tool for AWS CloudFormation
upload_time2024-03-14 01:36:29
maintainer
docs_urlNone
authorMark Duffield
requires_python
licenseApache License 2.0
keywords aws cfn control cloudformation stack
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # AWS CFN Control [![Build Status](https://app.travis-ci.com/awslabs/aws-cfn-control.svg?branch=master)](https://travis-ci.org/awslabs/aws-cfn-control) [![PyPi Status](https://badge.fury.io/py/aws-cfn-control.png)](https://badge.fury.io/py/aws-cfn-control)

AWS-CFN-Control provides a command line interface to quickly deploy and redeploy [AWS CloudFormation stacks](https://aws.amazon.com/cloudformation/). The `cfnctl` command provides the core functionality, with several other commands that will find AMI info, get stack status, build CloudFormation mappings, and other features. AWS CFN Control will handle CloudFormation templates that have parameters, and you want to create stacks with the same parameters in multiple regions, or you want to change just a few parameters values for a new stack.


## License

This library is licensed under the Apache 2.0 License. 

## Prerequisites

It is assumed that you have an AWS account (preferably with admin privileges) and experience with CloudFormation. You will also need to be familiar with either [AWS Cloud Development Kit](https://aws.amazon.com/cdk/) (CDK) or writing your own CloudFormation templates. Although JSON or YAML formatted templates can be used, JSON is recommended. 

## Installation

```
pip install aws-cfn-control
```

## TL;DR

1. Build cfnctl parameters file
1. Launch the stack
1. Check stack status and outputs

## Usage overview 

#### Build the parameters file for a CloudFormation template:
This command builds a default parameters file:

```cfnctl build -t <template_file>```

#### Create a stack using the template or a parameters file: 

This first create command (using -t) first checks if there is an existing parameters file, and prompts if it should be used. Otherwise, a parameters file is created using the stack name (-n) appended to the template file name. You are then prompted for the stack parameters (similar to build action), and then the stack is created.

```cfnctl create -n stack001 -t <template_file>```

This second command (using -f) uses an existing parameters file, which has the template location, to create a stack. You will not be prompted for any parameters:

```cfnctl create -n stack001 -f <parameters_file>```

#### List all existing stacks 

```cfnctl list```

#### List detials of one existing stack 

```cfnctl list -n stack001```

#### Delete a stack

```cfnctl delete -n <stack_name>```

## More detailed information

### Command help

```text
usage: cfnctl [-h] [-r REGION] [-n STACK_NAME] [-t TEMPLATE] [-f PARAM_FILE] [-d] [-b BUCKET] [-nr] [-p AWS_PROFILE] [-y] [-v] cfn_action

Launch and manage CloudFormation templates from the command line

positional arguments:
  cfn_action      REQUIRED: Action: build|create|list|delete
                    build    Builds the CFN parameter file (-t required)
                    create   Creates a new stack (-n and [-t|-f] required)
                    list     List all stacks (-d provides extra detail)
                    delete   Deletes a stack (-n is required)

arguments:
  -h, --help      show this help message and exit
  -r REGION       Region name
  -n STACK_NAME   Stack name
  -t TEMPLATE     CFN Template from local file or S3 URL
  -f PARAM_FILE   Template parameter file
  -d              List details on all stacks
  -b BUCKET       Bucket to upload template to
  -nr             Do not rollback
  -p AWS_PROFILE  AWS Profile
  -y              On interactive question, force yes
  -v              Verbose config file
```

### Using the defaults from CloudFormation templates and seeing existing resources

When using the ```build``` or ```create``` actions, as you are prompted for each parameter you will be given the choice of choosing the default value specified in the template. For example, if your template has this:
```text
    "MyInstanceType": {
      "Default": "m5.24xlarge",
      "Description": "Instance type",
      "Type": "String"
    },
```

Your prompt will have the default value included, and you just hit entire to accept the default:
```text
MyInstanceType [m5.24xlarge]:
```

#### Existing resources

For some resources, a list of existing values will be shown. For example, here is what the list of subnets look like, with the default set to ```subnet-abbbcccbbbbcd1235```:

```text
Getting subnets for vpc-0000aaaa1111bbbb2 ...
  subnet-aaaabbbcccbcd1234 | us-east-1b
  subnet-abbbcccbbbbcd12gg | us-east-1-bos-1a | Local Zone Subnet
  subnet-abbbcccbbbbcd1235 | us-east-1a
  subnet-addddbbbccbcd1232 | us-east-1f
  subnet-addddbbbccbcd1236 | us-east-1c
  subnet-addddbbbccbcd1238 | us-east-1e
  subnet-aaabbbbcccbcd1237 | us-east-1d
Select subnet: [subnet-abbbcccbbbbcd1235]: 
```

#### Using a region defaults file

You can set parameter defaults with a region defaults file located in the ```~/.cfnparam directory,``` for example ```~/.cfnparam/<region>.default```. If the region defaults file exists, then that file will be used for default values. This will override the existing default value in the template. The region names used will be the AWS API region name, for example: us-west-2, us-east-1, etc.

If the region defaults file exists, you should see this message when running the ```create``` command:
```text
Using region defaults file /Users/joeuser/.cfnparam/us-east-2.default for parameter defaults
```

You can create the region defaults file by first creating a paramaters file using the ```build``` command, then move or copy that parameters file to the region defaults file.

#### Required parameters

If a parameter is defined as required (```ConstraintDescription``` is used in the template), and you have not provided a value, you will see one of two messages.

1. If you ran ```cfnctl build``` you will see a message similar to this:

```text
WARNING ONLY: Parameter "MyS3Bucket" is required but can be updated in parameters file and left empty for now
```

2. If you ran ```cfnctl create``` you will see a message similar this:
```text
MyS3Bucket []: 
 REQUIREMENT: Parameter "MyS3Bucket" is required to create the stack, please enter a value, optionally exit create and rerun with build action
MyS3Bucket: 
Required parameter MyS3Bucket not entered. The stack create will fail, but the parameters file will still be built.
```

After the build completes you will see this message, reminding you to update the value in the parameters file:

```text
Some values are still needed, replace "<VALUE_NEEDED>" in /Users/joeuser/.cfnparam/My_Instance.json.default
```

In the parameters file you will see this, for ```MyS3Bucket```:

```text
MyS3Bucket                          = <VALUE_NEEDED>
```

You will need to change ```<VALUE_NEEDED>``` to a valid parameter to create the stack successfully.



### Optional (but recommended): Build cfnctl parameters file  (stored in ~/.cfnparam/)

When you run ```cfnctl build``` you will be prompted for each of the parameter values. The ```build``` process accounts for default values, and you will be double prompted on any parameter that is using ```ConstraintDescription``` and does not have a value. A file with parameters and the template location will be saved in the ```~/.cfnparam/``` directory with ```.default``` appended to the template name. For example, the default parameter file for the template named ```stack1.json```, is ```~/.cfnparam/stack1.json.default```.

Here is an example of running the ```cfnctl build``` command:

```text
$ cfnctl build -t My_Instance.json                   
Using AWS credentials profile "default"
Looks like we're in us-east-1
Creating parameters file /Users/joeuser/.cfnparam/My_Instance.json.default
EC2 keys found in us-east-1:
  Testing1 
  Joeuser_IAD 
Select EC2 Key [Joeuser_IAD]: 
Getting VPC info...
  vpc-0000aaaa1111bbbb2 | 10.0.0.0/16 | False | test1-VPC
  vpc-aaaabbbbeebce1234 | 172.31.0.0/16 | True | default-vpc
Select VPC [vpc-aaaabbbbeebce1234]: vpc-0000aaaa1111bbbb2 
Getting security groups for vpc-0000aaaa1111bbbb2 ...
  sg-1111aaaa3333bbbbcc | launch-wizard-1
  sg-2222bbbbcccc333334 | Ent-network
  sg-bbbccaa1234124efgh | default
Select secuirty group [sg-bbbccaa1234124efgh]: 
MyInstanceType [m5.2xlarge]:  t3.small 
OperatingSystem [centos7]:  alinux2
SshAccessCidr [111.222.333.444/32]:  333.333.444.444/32 
MyS3Bucket []: 
 WARNING ONLY: Parameter "MyS3Bucket" is required but can be updated in parameters file and left empty for now
MyS3Bucket: 
Getting subnets for vpc-0000aaaa1111bbbb2 ...
  subnet-aaaabbbcccbcd1234 | us-east-1b
  subnet-abbbcccbbbbcd12gg | us-east-1-bos-1a | Local Zone Subnet
  subnet-abbbcccbbbbcd1235 | us-east-1a
  subnet-addddbbbccbcd1232 | us-east-1f
  subnet-addddbbbccbcd1236 | us-east-1c
  subnet-addddbbbccbcd1238 | us-east-1e
  subnet-aaabbbbcccbcd1237 | us-east-1d
Select subnet: [subnet-abbbcccbbbbcd1235]: 
UsePublicIp [true]: 
Some values are still needed, replace "<VALUE_NEEDED>" in /Users/joeuser/.cfnparam/My_Instance.json.default
Done building cfnctl parameters file /Users/joeuser/.cfnparam/My_Instance.json.default, includes template location
```

#### Edit the parameters file, and fill in values as needed 

After running the ```cfnctl build```, in your home directory under ```~/.cfnparam/```, you will find a parameters file. Edit the parameters file as needed, if you see ```<VALUE_NEEDED>```, those values can not be null for a successful stack luanch.

Example parameters file:

```text
[AWS-Config]
TemplateBody = /Users/joeuser/templates/My_Instance.json 

[Paramters]
EC2KeyName                          = Joeuser_IAD 
ExistingSecurityGroup               = sg-bbbccaa1234124efgh 
MyInstanceType                      = t3.small
OperatingSystem                     = alinux2 
SshAccessCidr                       = 333.333.444.444/32 
SshBucket                           = <VALUE_NEEDED>
Subnet                              = subnet-abbbcccbbbbcd1235 
UsePublicIp                         = true
VpcId                               = vpc-aaaabbbbeebce1234 
```


### Create the stack 

The stack can be created in two ways, either with the ```-t``` flag or the ```-f``` flag

#### 1. Create with the ```-t``` flag

If you already created the parameters file (steps above), when you run the create command you will be prompted to choose from either the existing (default) parameters file, or continue the create while answering the parameters questions again.

For example, if the default parameters file exists you will see this:

```
$ cfnctl create -n teststack1 -t My_Instance.json
Using AWS credentials profile "default"
Looks like we're in us-east-1
Default parameters file /Users/joeuser/.cfnparam/My_Instance.json.default exists, use this file [Y/n]:  
```
Answering "y" will create the stack using the values from the previously created default parameters file. 

If you answer "n", you will be prompted for each parameter, and the parameters will be saved in the ```~/.cfnparam/``` directory with the values used to create the stack. The parameters file name is the stack name appended to the template file name. For example, the parameters file for the template named ```My_Instance.json``` when specifying the stack name ```teststack1```, will be ```~/.cfnparam/My_Instance.json.teststack1```:

```text
$ cfnctl create -n teststack1 -t My_Instance.json
Using AWS credentials profile "default"
Looks like we're in us-east-1
Default parameters file /Users/joeuser/.cfnparam/My_Instance.json.default exists, use this file [Y/n]: n
Stack parameters file does not exists, continuing...
Creating parameters file /Users/joeuser/.cfnparam/My_Instance.json.teststack1
...
```

#### 2. Create with the ```-f``` flag

You can use any parameters file (using ```-f```) to create a stack, as the parameters file has the template location and the paramters.

For example, to create a new stack (teststack2) using all the parameters from the previously created stack named ```teststack1```, you run this: 

```
$ cfnctl create -n teststack2 -f ~/.cfnparam/My_Instance.json.teststack1
```

#### Example ```cfnctl create``` using the default parameters file (from ```cfnctl build```):

Here is example output from a ```cfnctl create```, using the previously created default parameters file. The status of the stack, the parameters used, and the output(s) are also displayed:

```
$ cfnctl create -n teststack1 -t My_Instance.json
Using AWS credentials profile "default"
Looks like we're in us-east-1
Default parameters file /Users/joeuser/.cfnparam/My_Instance.json.default exists, use this file [Y/n]:  
Using parameters file: /Users/joeuser/.cfnparam/My_Instance.json.default 
Using template file: /Users/joeuser/templates/My_Instance.json 
Attempting to launch teststack1 
teststack1                             :  CREATE_IN_PROGRESS        :  User Initiated
SshSecurityGroup                       :  CREATE_IN_PROGRESS       
InstanceWaitHandle                     :  CREATE_IN_PROGRESS       
RootRole                               :  CREATE_IN_PROGRESS       
InstanceWaitHandle                     :  CREATE_IN_PROGRESS        :  Resource creation Initiated
InstanceWaitHandle                     :  CREATE_COMPLETE          
RootRole                               :  CREATE_IN_PROGRESS        :  Resource creation Initiated
SshSecurityGroup                       :  CREATE_IN_PROGRESS        :  Resource creation Initiated
SshSecurityGroup                       :  CREATE_COMPLETE          
RootRole                               :  CREATE_COMPLETE          
RootInstanceProfile                    :  CREATE_IN_PROGRESS       
RootInstanceProfile                    :  CREATE_IN_PROGRESS        :  Resource creation Initiated
RootInstanceProfile                    :  CREATE_COMPLETE          
MyInstance                             :  CREATE_IN_PROGRESS       
MyInstance                             :  CREATE_IN_PROGRESS        :  Resource creation Initiated
MyInstance                             :  CREATE_COMPLETE          
InstanceWaitCondition                  :  CREATE_IN_PROGRESS       
InstanceWaitCondition                  :  CREATE_IN_PROGRESS        :  Resource creation Initiated
InstanceWaitCondition                  :  CREATE_COMPLETE          
teststack1                             :  CREATE_COMPLETE          

Status:
teststack1                               2021-09-16 14:35:11   CREATE_COMPLETE                test instance launch

[Parameters]
ExistingSecurityGroup                  = sg-bbbccaa1234124efgh 
OperatingSystem                        = alinux2 
VpcId                                  = vpc-aaaabbbbeebce1234 
UsePublicIp                            = true                          
SshAccessCidr                          = 333.333.444.444/32 
EC2KeyName                             = Joeuser_IAD 
MyInstanceType                         = t3.small 
Subnet                                 = subnet-abbbcccbbbbcd1235 

[Outputs]
InstanceID                             = i-00011100022200333
InstancePublicIP                       = 54.12.11.13 
InstancePrivateIP                      = 172.25.5.5
```

## Change Log


## ToDo list

* Add catch-all for help 


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/awslabs/aws-cfn-control",
    "name": "aws-cfn-control",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "aws cfn control cloudformation stack",
    "author": "Mark Duffield",
    "author_email": "duff@amazon.com",
    "download_url": "https://files.pythonhosted.org/packages/b4/a9/e8e474196df8cb00f286ed34e987e93796a274e0b803bafd09d515936f21/aws-cfn-control-1.0.12.tar.gz",
    "platform": null,
    "description": "# AWS CFN Control [![Build Status](https://app.travis-ci.com/awslabs/aws-cfn-control.svg?branch=master)](https://travis-ci.org/awslabs/aws-cfn-control) [![PyPi Status](https://badge.fury.io/py/aws-cfn-control.png)](https://badge.fury.io/py/aws-cfn-control)\n\nAWS-CFN-Control provides a command line interface to quickly deploy and redeploy [AWS CloudFormation stacks](https://aws.amazon.com/cloudformation/). The `cfnctl` command provides the core functionality, with several other commands that will find AMI info, get stack status, build CloudFormation mappings, and other features. AWS CFN Control will handle CloudFormation templates that have parameters, and you want to create stacks with the same parameters in multiple regions, or you want to change just a few parameters values for a new stack.\n\n\n## License\n\nThis library is licensed under the Apache 2.0 License. \n\n## Prerequisites\n\nIt is assumed that you have an AWS account (preferably with admin privileges) and experience with CloudFormation. You will also need to be familiar with either [AWS Cloud Development Kit](https://aws.amazon.com/cdk/) (CDK) or writing your own CloudFormation templates. Although JSON or YAML formatted templates can be used, JSON is recommended. \n\n## Installation\n\n```\npip install aws-cfn-control\n```\n\n## TL;DR\n\n1. Build cfnctl parameters file\n1. Launch the stack\n1. Check stack status and outputs\n\n## Usage overview \n\n#### Build the parameters file for a CloudFormation template:\nThis command builds a default parameters file:\n\n```cfnctl build -t <template_file>```\n\n#### Create a stack using the template or a parameters file: \n\nThis first create command (using -t) first checks if there is an existing parameters file, and prompts if it should be used. Otherwise, a parameters file is created using the stack name (-n) appended to the template file name. You are then prompted for the stack parameters (similar to build action), and then the stack is created.\n\n```cfnctl create -n stack001 -t <template_file>```\n\nThis second command (using -f) uses an existing parameters file, which has the template location, to create a stack. You will not be prompted for any parameters:\n\n```cfnctl create -n stack001 -f <parameters_file>```\n\n#### List all existing stacks \n\n```cfnctl list```\n\n#### List detials of one existing stack \n\n```cfnctl list -n stack001```\n\n#### Delete a stack\n\n```cfnctl delete -n <stack_name>```\n\n## More detailed information\n\n### Command help\n\n```text\nusage: cfnctl [-h] [-r REGION] [-n STACK_NAME] [-t TEMPLATE] [-f PARAM_FILE] [-d] [-b BUCKET] [-nr] [-p AWS_PROFILE] [-y] [-v] cfn_action\n\nLaunch and manage CloudFormation templates from the command line\n\npositional arguments:\n  cfn_action      REQUIRED: Action: build|create|list|delete\n                    build    Builds the CFN parameter file (-t required)\n                    create   Creates a new stack (-n and [-t|-f] required)\n                    list     List all stacks (-d provides extra detail)\n                    delete   Deletes a stack (-n is required)\n\narguments:\n  -h, --help      show this help message and exit\n  -r REGION       Region name\n  -n STACK_NAME   Stack name\n  -t TEMPLATE     CFN Template from local file or S3 URL\n  -f PARAM_FILE   Template parameter file\n  -d              List details on all stacks\n  -b BUCKET       Bucket to upload template to\n  -nr             Do not rollback\n  -p AWS_PROFILE  AWS Profile\n  -y              On interactive question, force yes\n  -v              Verbose config file\n```\n\n### Using the defaults from CloudFormation templates and seeing existing resources\n\nWhen using the ```build``` or ```create``` actions, as you are prompted for each parameter you will be given the choice of choosing the default value specified in the template. For example, if your template has this:\n```text\n    \"MyInstanceType\": {\n      \"Default\": \"m5.24xlarge\",\n      \"Description\": \"Instance type\",\n      \"Type\": \"String\"\n    },\n```\n\nYour prompt will have the default value included, and you just hit entire to accept the default:\n```text\nMyInstanceType [m5.24xlarge]:\n```\n\n#### Existing resources\n\nFor some resources, a list of existing values will be shown. For example, here is what the list of subnets look like, with the default set to ```subnet-abbbcccbbbbcd1235```:\n\n```text\nGetting subnets for vpc-0000aaaa1111bbbb2 ...\n  subnet-aaaabbbcccbcd1234 | us-east-1b\n  subnet-abbbcccbbbbcd12gg | us-east-1-bos-1a | Local Zone Subnet\n  subnet-abbbcccbbbbcd1235 | us-east-1a\n  subnet-addddbbbccbcd1232 | us-east-1f\n  subnet-addddbbbccbcd1236 | us-east-1c\n  subnet-addddbbbccbcd1238 | us-east-1e\n  subnet-aaabbbbcccbcd1237 | us-east-1d\nSelect subnet: [subnet-abbbcccbbbbcd1235]: \n```\n\n#### Using a region defaults file\n\nYou can set parameter defaults with a region defaults file located in the ```~/.cfnparam directory,``` for example ```~/.cfnparam/<region>.default```. If the region defaults file exists, then that file will be used for default values. This will override the existing default value in the template. The region names used will be the AWS API region name, for example: us-west-2, us-east-1, etc.\n\nIf the region defaults file exists, you should see this message when running the ```create``` command:\n```text\nUsing region defaults file /Users/joeuser/.cfnparam/us-east-2.default for parameter defaults\n```\n\nYou can create the region defaults file by first creating a paramaters file using the ```build``` command, then move or copy that parameters file to the region defaults file.\n\n#### Required parameters\n\nIf a parameter is defined as required (```ConstraintDescription``` is used in the template), and you have not provided a value, you will see one of two messages.\n\n1. If you ran ```cfnctl build``` you will see a message similar to this:\n\n```text\nWARNING ONLY: Parameter \"MyS3Bucket\" is required but can be updated in parameters file and left empty for now\n```\n\n2. If you ran ```cfnctl create``` you will see a message similar this:\n```text\nMyS3Bucket []: \n REQUIREMENT: Parameter \"MyS3Bucket\" is required to create the stack, please enter a value, optionally exit create and rerun with build action\nMyS3Bucket: \nRequired parameter MyS3Bucket not entered. The stack create will fail, but the parameters file will still be built.\n```\n\nAfter the build completes you will see this message, reminding you to update the value in the parameters file:\n\n```text\nSome values are still needed, replace \"<VALUE_NEEDED>\" in /Users/joeuser/.cfnparam/My_Instance.json.default\n```\n\nIn the parameters file you will see this, for ```MyS3Bucket```:\n\n```text\nMyS3Bucket                          = <VALUE_NEEDED>\n```\n\nYou will need to change ```<VALUE_NEEDED>``` to a valid parameter to create the stack successfully.\n\n\n\n### Optional (but recommended): Build cfnctl parameters file  (stored in ~/.cfnparam/)\n\nWhen you run ```cfnctl build``` you will be prompted for each of the parameter values. The ```build``` process accounts for default values, and you will be double prompted on any parameter that is using ```ConstraintDescription``` and does not have a value. A file with parameters and the template location will be saved in the ```~/.cfnparam/``` directory with ```.default``` appended to the template name. For example, the default parameter file for the template named ```stack1.json```, is ```~/.cfnparam/stack1.json.default```.\n\nHere is an example of running the ```cfnctl build``` command:\n\n```text\n$ cfnctl build -t My_Instance.json                   \nUsing AWS credentials profile \"default\"\nLooks like we're in us-east-1\nCreating parameters file /Users/joeuser/.cfnparam/My_Instance.json.default\nEC2 keys found in us-east-1:\n  Testing1 \n  Joeuser_IAD \nSelect EC2 Key [Joeuser_IAD]: \nGetting VPC info...\n  vpc-0000aaaa1111bbbb2 | 10.0.0.0/16 | False | test1-VPC\n  vpc-aaaabbbbeebce1234 | 172.31.0.0/16 | True | default-vpc\nSelect VPC [vpc-aaaabbbbeebce1234]: vpc-0000aaaa1111bbbb2 \nGetting security groups for vpc-0000aaaa1111bbbb2 ...\n  sg-1111aaaa3333bbbbcc | launch-wizard-1\n  sg-2222bbbbcccc333334 | Ent-network\n  sg-bbbccaa1234124efgh | default\nSelect secuirty group [sg-bbbccaa1234124efgh]: \nMyInstanceType [m5.2xlarge]:  t3.small \nOperatingSystem [centos7]:  alinux2\nSshAccessCidr [111.222.333.444/32]:  333.333.444.444/32 \nMyS3Bucket []: \n WARNING ONLY: Parameter \"MyS3Bucket\" is required but can be updated in parameters file and left empty for now\nMyS3Bucket: \nGetting subnets for vpc-0000aaaa1111bbbb2 ...\n  subnet-aaaabbbcccbcd1234 | us-east-1b\n  subnet-abbbcccbbbbcd12gg | us-east-1-bos-1a | Local Zone Subnet\n  subnet-abbbcccbbbbcd1235 | us-east-1a\n  subnet-addddbbbccbcd1232 | us-east-1f\n  subnet-addddbbbccbcd1236 | us-east-1c\n  subnet-addddbbbccbcd1238 | us-east-1e\n  subnet-aaabbbbcccbcd1237 | us-east-1d\nSelect subnet: [subnet-abbbcccbbbbcd1235]: \nUsePublicIp [true]: \nSome values are still needed, replace \"<VALUE_NEEDED>\" in /Users/joeuser/.cfnparam/My_Instance.json.default\nDone building cfnctl parameters file /Users/joeuser/.cfnparam/My_Instance.json.default, includes template location\n```\n\n#### Edit the parameters file, and fill in values as needed \n\nAfter running the ```cfnctl build```, in your home directory under ```~/.cfnparam/```, you will find a parameters file. Edit the parameters file as needed, if you see ```<VALUE_NEEDED>```, those values can not be null for a successful stack luanch.\n\nExample parameters file:\n\n```text\n[AWS-Config]\nTemplateBody = /Users/joeuser/templates/My_Instance.json \n\n[Paramters]\nEC2KeyName                          = Joeuser_IAD \nExistingSecurityGroup               = sg-bbbccaa1234124efgh \nMyInstanceType                      = t3.small\nOperatingSystem                     = alinux2 \nSshAccessCidr                       = 333.333.444.444/32 \nSshBucket                           = <VALUE_NEEDED>\nSubnet                              = subnet-abbbcccbbbbcd1235 \nUsePublicIp                         = true\nVpcId                               = vpc-aaaabbbbeebce1234 \n```\n\n\n### Create the stack \n\nThe stack can be created in two ways, either with the ```-t``` flag or the ```-f``` flag\n\n#### 1. Create with the ```-t``` flag\n\nIf you already created the parameters file (steps above), when you run the create command you will be prompted to choose from either the existing (default) parameters file, or continue the create while answering the parameters questions again.\n\nFor example, if the default parameters file exists you will see this:\n\n```\n$ cfnctl create -n teststack1 -t My_Instance.json\nUsing AWS credentials profile \"default\"\nLooks like we're in us-east-1\nDefault parameters file /Users/joeuser/.cfnparam/My_Instance.json.default exists, use this file [Y/n]:  \n```\nAnswering \"y\" will create the stack using the values from the previously created default parameters file. \n\nIf you answer \"n\", you will be prompted for each parameter, and the parameters will be saved in the ```~/.cfnparam/``` directory with the values used to create the stack. The parameters file name is the stack name appended to the template file name. For example, the parameters file for the template named ```My_Instance.json``` when specifying the stack name ```teststack1```, will be ```~/.cfnparam/My_Instance.json.teststack1```:\n\n```text\n$ cfnctl create -n teststack1 -t My_Instance.json\nUsing AWS credentials profile \"default\"\nLooks like we're in us-east-1\nDefault parameters file /Users/joeuser/.cfnparam/My_Instance.json.default exists, use this file [Y/n]: n\nStack parameters file does not exists, continuing...\nCreating parameters file /Users/joeuser/.cfnparam/My_Instance.json.teststack1\n...\n```\n\n#### 2. Create with the ```-f``` flag\n\nYou can use any parameters file (using ```-f```) to create a stack, as the parameters file has the template location and the paramters.\n\nFor example, to create a new stack (teststack2) using all the parameters from the previously created stack named ```teststack1```, you run this: \n\n```\n$ cfnctl create -n teststack2 -f ~/.cfnparam/My_Instance.json.teststack1\n```\n\n#### Example ```cfnctl create``` using the default parameters file (from ```cfnctl build```):\n\nHere is example output from a ```cfnctl create```, using the previously created default parameters file. The status of the stack, the parameters used, and the output(s) are also displayed:\n\n```\n$ cfnctl create -n teststack1 -t My_Instance.json\nUsing AWS credentials profile \"default\"\nLooks like we're in us-east-1\nDefault parameters file /Users/joeuser/.cfnparam/My_Instance.json.default exists, use this file [Y/n]:  \nUsing parameters file: /Users/joeuser/.cfnparam/My_Instance.json.default \nUsing template file: /Users/joeuser/templates/My_Instance.json \nAttempting to launch teststack1 \nteststack1                             :  CREATE_IN_PROGRESS        :  User Initiated\nSshSecurityGroup                       :  CREATE_IN_PROGRESS       \nInstanceWaitHandle                     :  CREATE_IN_PROGRESS       \nRootRole                               :  CREATE_IN_PROGRESS       \nInstanceWaitHandle                     :  CREATE_IN_PROGRESS        :  Resource creation Initiated\nInstanceWaitHandle                     :  CREATE_COMPLETE          \nRootRole                               :  CREATE_IN_PROGRESS        :  Resource creation Initiated\nSshSecurityGroup                       :  CREATE_IN_PROGRESS        :  Resource creation Initiated\nSshSecurityGroup                       :  CREATE_COMPLETE          \nRootRole                               :  CREATE_COMPLETE          \nRootInstanceProfile                    :  CREATE_IN_PROGRESS       \nRootInstanceProfile                    :  CREATE_IN_PROGRESS        :  Resource creation Initiated\nRootInstanceProfile                    :  CREATE_COMPLETE          \nMyInstance                             :  CREATE_IN_PROGRESS       \nMyInstance                             :  CREATE_IN_PROGRESS        :  Resource creation Initiated\nMyInstance                             :  CREATE_COMPLETE          \nInstanceWaitCondition                  :  CREATE_IN_PROGRESS       \nInstanceWaitCondition                  :  CREATE_IN_PROGRESS        :  Resource creation Initiated\nInstanceWaitCondition                  :  CREATE_COMPLETE          \nteststack1                             :  CREATE_COMPLETE          \n\nStatus:\nteststack1                               2021-09-16 14:35:11   CREATE_COMPLETE                test instance launch\n\n[Parameters]\nExistingSecurityGroup                  = sg-bbbccaa1234124efgh \nOperatingSystem                        = alinux2 \nVpcId                                  = vpc-aaaabbbbeebce1234 \nUsePublicIp                            = true                          \nSshAccessCidr                          = 333.333.444.444/32 \nEC2KeyName                             = Joeuser_IAD \nMyInstanceType                         = t3.small \nSubnet                                 = subnet-abbbcccbbbbcd1235 \n\n[Outputs]\nInstanceID                             = i-00011100022200333\nInstancePublicIP                       = 54.12.11.13 \nInstancePrivateIP                      = 172.25.5.5\n```\n\n## Change Log\n\n\n## ToDo list\n\n* Add catch-all for help \n\n",
    "bugtrack_url": null,
    "license": "Apache License 2.0",
    "summary": "Command line launch and management tool for AWS CloudFormation",
    "version": "1.0.12",
    "project_urls": {
        "Homepage": "https://github.com/awslabs/aws-cfn-control"
    },
    "split_keywords": [
        "aws",
        "cfn",
        "control",
        "cloudformation",
        "stack"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b4a9e8e474196df8cb00f286ed34e987e93796a274e0b803bafd09d515936f21",
                "md5": "feedbbd9802c5d6bd8cd9d8e43157cc8",
                "sha256": "7ee80ed54ef959d80a1025aa237bcd066d1514242b25dc9d5ab4b11447424e06"
            },
            "downloads": -1,
            "filename": "aws-cfn-control-1.0.12.tar.gz",
            "has_sig": false,
            "md5_digest": "feedbbd9802c5d6bd8cd9d8e43157cc8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 26723,
            "upload_time": "2024-03-14T01:36:29",
            "upload_time_iso_8601": "2024-03-14T01:36:29.916759Z",
            "url": "https://files.pythonhosted.org/packages/b4/a9/e8e474196df8cb00f286ed34e987e93796a274e0b803bafd09d515936f21/aws-cfn-control-1.0.12.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-14 01:36:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "awslabs",
    "github_project": "aws-cfn-control",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "aws-cfn-control"
}
        
Elapsed time: 0.20673s