.. image:: https://readthedocs.org/projects/aws_cloudformation/badge/?version=latest
:target: https://aws_cloudformation.readthedocs.io/index.html
:alt: Documentation Status
.. image:: https://github.com/MacHu-GWU/aws_cloudformation-project/workflows/CI/badge.svg
:target: https://github.com/MacHu-GWU/aws_cloudformation-project/actions?query=workflow:CI
.. image:: https://codecov.io/gh/MacHu-GWU/aws_cloudformation-project/branch/main/graph/badge.svg
:target: https://codecov.io/gh/MacHu-GWU/aws_cloudformation-project
.. image:: https://img.shields.io/pypi/v/aws_cloudformation.svg
:target: https://pypi.python.org/pypi/aws_cloudformation
.. image:: https://img.shields.io/pypi/l/aws_cloudformation.svg
:target: https://pypi.python.org/pypi/aws_cloudformation
.. image:: https://img.shields.io/pypi/pyversions/aws_cloudformation.svg
:target: https://pypi.python.org/pypi/aws_cloudformation
.. image:: https://img.shields.io/badge/Release_History!--None.svg?style=social
:target: https://github.com/MacHu-GWU/aws_cloudformation-project/blob/main/release-history.rst
.. image:: https://img.shields.io/badge/STAR_Me_on_GitHub!--None.svg?style=social
:target: https://github.com/MacHu-GWU/aws_cloudformation-project
------
.. image:: https://img.shields.io/badge/Link-Document-blue.svg
:target: https://aws_cloudformation.readthedocs.io/index.html
.. image:: https://img.shields.io/badge/Link-API-blue.svg
:target: https://aws_cloudformation.readthedocs.io/py-modindex.html
.. image:: https://img.shields.io/badge/Link-Source_Code-blue.svg
:target: https://aws_cloudformation.readthedocs.io/py-modindex.html
.. image:: https://img.shields.io/badge/Link-Install-blue.svg
:target: `install`_
.. image:: https://img.shields.io/badge/Link-GitHub-blue.svg
:target: https://github.com/MacHu-GWU/aws_cloudformation-project
.. image:: https://img.shields.io/badge/Link-Submit_Issue-blue.svg
:target: https://github.com/MacHu-GWU/aws_cloudformation-project/issues
.. image:: https://img.shields.io/badge/Link-Request_Feature-blue.svg
:target: https://github.com/MacHu-GWU/aws_cloudformation-project/issues
.. image:: https://img.shields.io/badge/Link-Download-blue.svg
:target: https://pypi.org/pypi/aws_cloudformation#files
Welcome to ``aws_cloudformation`` Documentation
==============================================================================
AWS CloudFormation deployment for human, Enable ``terraform plan``, ``terraform apply`` styled deployment.
**Features**:
1. Preview the change set details before deployment.
2. Automatically upload big template to S3 before deployment, even for nested template.
3. Support SYNC call for deployment and deletion, wait until it success or fail (the original API is ASYNC call).
4. Allow prompt for user to enter "YES" to proceed.
5. Provide hyperlink for one-click to jump to the Console to preview.
.. contents:: Table of Content
:class: this-will-duplicate-information-and-it-is-still-useful-here
:depth: 1
:local:
Talk is cheap, show me the code
------------------------------------------------------------------------------
⭐ **Console Output**:
.. code-block:: bash
============== Deploy stack: 'cottonformation-deploy-stack-test' ===============
preview stack in AWS CloudFormation console: https://console.aws.amazon.com/cloudformation/home?#/stacks?filteringStatus=active&filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false
preview **change set details** at: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/changesets/changes?stackId=arn:aws:cloudformation:us-east-1:111122223333:stack/cottonformation-deploy-stack-test/0c5596c0-76b4-11ed-92b1-0a0bcad48579&changeSetId=arn:aws:cloudformation:us-east-1:111122223333:changeSet/cottonformation-deploy-stack-test-2022-12-08-04-51-58-892/8c88d0c1-d5c7-495b-820e-29e5752a04d4
wait for change set creation to finish ...
on 1 th attempt, elapsed 5 seconds, remain 55 seconds ...
reached status CREATE_COMPLETE
+---------------------------- Change Set Statistics -----------------------------
| 🟢 Add 1 Resource
|
+--------------------------------------------------------------------------------
+----------------------------------- Changes ------------------------------------
| 🟢 📦 Add Resource: Secret1 AWS::SecretsManager::Secret
|
+--------------------------------------------------------------------------------
need to execute the change set to apply those changes.
preview **create stack progress** at: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/stackinfo?filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false&stackId=arn:aws:cloudformation:us-east-1:111122223333:stack/cottonformation-deploy-stack-test/0c5596c0-76b4-11ed-92b1-0a0bcad48579&filteringStatus=active
wait for deploy to finish ...
on 2 th attempt, elapsed 10 seconds, remain 50 seconds ...
reached status 🟢 'CREATE_COMPLETE'
done
============== Deploy stack: 'cottonformation-deploy-stack-test' ===============
preview stack in AWS CloudFormation console: https://console.aws.amazon.com/cloudformation/home?#/stacks?filteringStatus=active&filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false
preview **change set details** at: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/changesets/changes?stackId=arn:aws:cloudformation:us-east-1:111122223333:stack/cottonformation-deploy-stack-test/0c5596c0-76b4-11ed-92b1-0a0bcad48579&changeSetId=arn:aws:cloudformation:us-east-1:111122223333:changeSet/cottonformation-deploy-stack-test-2022-12-08-04-52-39-134/8e1fd139-7a37-43dd-9378-40a328970036
wait for change set creation to finish ...
on 1 th attempt, elapsed 5 seconds, remain 55 seconds ...
reached status CREATE_COMPLETE
+---------------------------- Change Set Statistics -----------------------------
| 🟢 Add 1 Resource
| 🔵 Modify 1 Resource
|
+--------------------------------------------------------------------------------
+----------------------------------- Changes ------------------------------------
| 🟢 📦 Add Resource: Secret222 AWS::SecretsManager::Secret
| 🔵 📦 Modify Resource: Secret1 AWS::SecretsManager::Secret
| 🔵 💡 Properties: Secret1 AWS::SecretsManager::Secret.Description
| 🔵 💡 Tags: Secret1 AWS::SecretsManager::Secret
|
+--------------------------------------------------------------------------------
need to execute the change set to apply those changes.
preview **update stack progress** at: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/stackinfo?filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false&stackId=arn:aws:cloudformation:us-east-1:111122223333:stack/cottonformation-deploy-stack-test/0c5596c0-76b4-11ed-92b1-0a0bcad48579&filteringStatus=active
wait for deploy to finish ...
on 3 th attempt, elapsed 15 seconds, remain 45 seconds ...
reached status 🟢 'UPDATE_COMPLETE'
done
============== Deploy stack: 'cottonformation-deploy-stack-test' ===============
preview stack in AWS CloudFormation console: https://console.aws.amazon.com/cloudformation/home?#/stacks?filteringStatus=active&filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false
preview **change set details** at: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/changesets/changes?stackId=arn:aws:cloudformation:us-east-1:111122223333:stack/cottonformation-deploy-stack-test/0c5596c0-76b4-11ed-92b1-0a0bcad48579&changeSetId=arn:aws:cloudformation:us-east-1:111122223333:changeSet/cottonformation-deploy-stack-test-2022-12-08-04-53-07-499/6edbcdf2-8e27-463f-bc5f-35587463fceb
wait for change set creation to finish ...
on 2 th attempt, elapsed 10 seconds, remain 50 seconds ...
reached status CREATE_COMPLETE
+---------------------------- Change Set Statistics -----------------------------
| 🟢 Add 1 Resource
| 🔵 Modify 1 Resource
| 🔴 Remove 1 Resource
|
+--------------------------------------------------------------------------------
+----------------------------------- Changes ------------------------------------
| 🟢 📦 Add Resource: Secret33333 AWS::SecretsManager::Secret
| 🔵 📦 Modify Resource: Secret222 AWS::SecretsManager::Secret
| 🔵 💡 Properties: Secret222 AWS::SecretsManager::Secret.Description
| 🔵 💡 Metadata: Secret222 AWS::SecretsManager::Secret
| 🔵 💡 CreationPolicy: Secret222 AWS::SecretsManager::Secret
| 🔵 💡 UpdatePolicy: Secret222 AWS::SecretsManager::Secret
| 🔵 💡 Tags: Secret222 AWS::SecretsManager::Secret
| 🔴 📦 Remove Resource: Secret1 AWS::SecretsManager::Secret
|
+--------------------------------------------------------------------------------
need to execute the change set to apply those changes.
preview **update stack progress** at: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/stackinfo?filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false&stackId=arn:aws:cloudformation:us-east-1:111122223333:stack/cottonformation-deploy-stack-test/0c5596c0-76b4-11ed-92b1-0a0bcad48579&filteringStatus=active
wait for deploy to finish ...
on 3 th attempt, elapsed 15 seconds, remain 45 seconds ...
reached status 🟢 'UPDATE_COMPLETE'
done
=============== Remove stack 'cottonformation-deploy-stack-test' ===============
preview stack in AWS CloudFormation console: https://console.aws.amazon.com/cloudformation/home?#/stacks?filteringStatus=active&filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false
wait for delete to finish ...
on 1 th attempt, elapsed 5 seconds, remain 55 seconds ...
already deleted.
done
⭐ **CloudFormation declaration**, see `cottonformation <https://github.com/MacHu-GWU/cottonformation-project>`_:
.. code-block:: python
# -*- coding: utf-8 -*-
import cottonformation as cf
from cottonformation.res import secretsmanager
def make_tpl_1() -> cf.Template:
"""
Create Secret1
"""
tpl = cf.Template()
secret1 = secretsmanager.Secret(
"Secret1",
p_Name="aws_cft_secret1",
p_Description="This is Secret 1",
p_Tags=[
cf.Tag(p_Key="Creator", p_Value="Alice"),
cf.Tag(p_Key="Description", p_Value="Hello"),
]
)
tpl.add(secret1)
return tpl
def make_tpl_2() -> cf.Template:
"""
Modify Secret1
Create Secret222
"""
tpl = make_tpl_1()
secret1: secretsmanager.Secret = tpl.Resources["Secret1"]
secret1.p_Description = "This must be Secret 1"
secret1.p_Tags = [
cf.Tag(p_Key="Creator", p_Value="Bob"),
cf.Tag(p_Key="Env", p_Value="Dev"),
]
secret2 = secretsmanager.Secret(
"Secret222",
p_Name="aws_cft_secret2",
p_Description="This is Secret 2",
)
tpl.add(secret2)
output_secret2_arn = cf.Output(
"Secret222Arn",
Value=secret2.ref(),
)
tpl.add(output_secret2_arn)
return tpl
def make_tpl_3() -> cf.Template:
"""
Delete Secret1
Modify Secret222
Create Secret33333
"""
tpl = make_tpl_2()
tpl.remove(tpl.Resources["Secret1"])
secret2: secretsmanager.Secret = tpl.Resources["Secret222"]
secret2.p_Description = "This definitely be Secret 2"
secret2.p_Tags = [
cf.Tag(p_Key="Creator", p_Value="Cathy"),
cf.Tag(p_Key="Env", p_Value="QA"),
]
secret2.ra_Metadata = {"email": "cathy@email.com"}
secret3 = secretsmanager.Secret(
"Secret33333",
p_Name="aws_cft_secret3",
p_Description="This is Secret 3",
)
tpl.add(secret3)
return tpl
⭐ **Deployment Script**:
.. code-block:: python
# -*- coding: utf-8 -*-
from aws_cloudformation.api import deploy_stack, remove_stack
from aws_cloudformation.tests import bsm
from aws_cloudformation.tests.stacks.secretmanager_stack import (
make_tpl_1,
make_tpl_2,
make_tpl_3,
)
stack_name = "cottonformation-deploy-stack-test"
deploy_stack(
bsm,
stack_name=stack_name,
template=make_tpl_1().to_json(),
skip_prompt=True, # by default, it prompt user input for YES / NO to proceed
# skip_plan=False, # by default, it does plan first
# wait=True, # by default, it waits the update to finish
)
deploy_stack(
bsm,
stack_name=stack_name,
template=make_tpl_2().to_json(),
skip_prompt=True,
)
deploy_stack(
bsm,
stack_name=stack_name,
template=make_tpl_3().to_json(),
skip_prompt=True,
)
remove_stack(
bsm,
stack_name=stack_name,
skip_prompt=True,
)
.. _install:
Install
------------------------------------------------------------------------------
``aws_cloudformation`` is released on PyPI, so all you need is:
.. code-block:: console
$ pip install aws_cloudformation
To upgrade to latest version:
.. code-block:: console
$ pip install --upgrade aws_cloudformation
Raw data
{
"_id": null,
"home_page": "https://github.com/MacHu-GWU/aws_cloudformation-project",
"name": "aws-cloudformation",
"maintainer": "Unknown",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Sanhe Hu",
"author_email": "husanhe@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/22/aa/876699f849ad80acf332aa9fd753d1e98a909136f853ecad5ca4bd3946d3/aws_cloudformation-1.5.1.tar.gz",
"platform": "Windows",
"description": ".. image:: https://readthedocs.org/projects/aws_cloudformation/badge/?version=latest\n :target: https://aws_cloudformation.readthedocs.io/index.html\n :alt: Documentation Status\n\n.. image:: https://github.com/MacHu-GWU/aws_cloudformation-project/workflows/CI/badge.svg\n :target: https://github.com/MacHu-GWU/aws_cloudformation-project/actions?query=workflow:CI\n\n.. image:: https://codecov.io/gh/MacHu-GWU/aws_cloudformation-project/branch/main/graph/badge.svg\n :target: https://codecov.io/gh/MacHu-GWU/aws_cloudformation-project\n\n.. image:: https://img.shields.io/pypi/v/aws_cloudformation.svg\n :target: https://pypi.python.org/pypi/aws_cloudformation\n\n.. image:: https://img.shields.io/pypi/l/aws_cloudformation.svg\n :target: https://pypi.python.org/pypi/aws_cloudformation\n\n.. image:: https://img.shields.io/pypi/pyversions/aws_cloudformation.svg\n :target: https://pypi.python.org/pypi/aws_cloudformation\n\n.. image:: https://img.shields.io/badge/Release_History!--None.svg?style=social\n :target: https://github.com/MacHu-GWU/aws_cloudformation-project/blob/main/release-history.rst\n\n.. image:: https://img.shields.io/badge/STAR_Me_on_GitHub!--None.svg?style=social\n :target: https://github.com/MacHu-GWU/aws_cloudformation-project\n\n------\n\n.. image:: https://img.shields.io/badge/Link-Document-blue.svg\n :target: https://aws_cloudformation.readthedocs.io/index.html\n\n.. image:: https://img.shields.io/badge/Link-API-blue.svg\n :target: https://aws_cloudformation.readthedocs.io/py-modindex.html\n\n.. image:: https://img.shields.io/badge/Link-Source_Code-blue.svg\n :target: https://aws_cloudformation.readthedocs.io/py-modindex.html\n\n.. image:: https://img.shields.io/badge/Link-Install-blue.svg\n :target: `install`_\n\n.. image:: https://img.shields.io/badge/Link-GitHub-blue.svg\n :target: https://github.com/MacHu-GWU/aws_cloudformation-project\n\n.. image:: https://img.shields.io/badge/Link-Submit_Issue-blue.svg\n :target: https://github.com/MacHu-GWU/aws_cloudformation-project/issues\n\n.. image:: https://img.shields.io/badge/Link-Request_Feature-blue.svg\n :target: https://github.com/MacHu-GWU/aws_cloudformation-project/issues\n\n.. image:: https://img.shields.io/badge/Link-Download-blue.svg\n :target: https://pypi.org/pypi/aws_cloudformation#files\n\n\nWelcome to ``aws_cloudformation`` Documentation\n==============================================================================\nAWS CloudFormation deployment for human, Enable ``terraform plan``, ``terraform apply`` styled deployment.\n\n**Features**:\n\n1. Preview the change set details before deployment.\n2. Automatically upload big template to S3 before deployment, even for nested template.\n3. Support SYNC call for deployment and deletion, wait until it success or fail (the original API is ASYNC call).\n4. Allow prompt for user to enter \"YES\" to proceed.\n5. Provide hyperlink for one-click to jump to the Console to preview.\n\n.. contents:: Table of Content\n :class: this-will-duplicate-information-and-it-is-still-useful-here\n :depth: 1\n :local:\n\n\nTalk is cheap, show me the code\n------------------------------------------------------------------------------\n\u2b50 **Console Output**:\n\n.. code-block:: bash\n\n ============== Deploy stack: 'cottonformation-deploy-stack-test' ===============\n preview stack in AWS CloudFormation console: https://console.aws.amazon.com/cloudformation/home?#/stacks?filteringStatus=active&filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false\n preview **change set details** at: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/changesets/changes?stackId=arn:aws:cloudformation:us-east-1:111122223333:stack/cottonformation-deploy-stack-test/0c5596c0-76b4-11ed-92b1-0a0bcad48579&changeSetId=arn:aws:cloudformation:us-east-1:111122223333:changeSet/cottonformation-deploy-stack-test-2022-12-08-04-51-58-892/8c88d0c1-d5c7-495b-820e-29e5752a04d4\n wait for change set creation to finish ...\n on 1 th attempt, elapsed 5 seconds, remain 55 seconds ...\n reached status CREATE_COMPLETE\n +---------------------------- Change Set Statistics -----------------------------\n | \ud83d\udfe2 Add 1 Resource\n |\n +--------------------------------------------------------------------------------\n +----------------------------------- Changes ------------------------------------\n | \ud83d\udfe2 \ud83d\udce6 Add Resource: Secret1 AWS::SecretsManager::Secret\n |\n +--------------------------------------------------------------------------------\n need to execute the change set to apply those changes.\n preview **create stack progress** at: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/stackinfo?filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false&stackId=arn:aws:cloudformation:us-east-1:111122223333:stack/cottonformation-deploy-stack-test/0c5596c0-76b4-11ed-92b1-0a0bcad48579&filteringStatus=active\n wait for deploy to finish ...\n on 2 th attempt, elapsed 10 seconds, remain 50 seconds ...\n reached status \ud83d\udfe2 'CREATE_COMPLETE'\n done\n\n\n ============== Deploy stack: 'cottonformation-deploy-stack-test' ===============\n preview stack in AWS CloudFormation console: https://console.aws.amazon.com/cloudformation/home?#/stacks?filteringStatus=active&filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false\n preview **change set details** at: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/changesets/changes?stackId=arn:aws:cloudformation:us-east-1:111122223333:stack/cottonformation-deploy-stack-test/0c5596c0-76b4-11ed-92b1-0a0bcad48579&changeSetId=arn:aws:cloudformation:us-east-1:111122223333:changeSet/cottonformation-deploy-stack-test-2022-12-08-04-52-39-134/8e1fd139-7a37-43dd-9378-40a328970036\n wait for change set creation to finish ...\n on 1 th attempt, elapsed 5 seconds, remain 55 seconds ...\n reached status CREATE_COMPLETE\n +---------------------------- Change Set Statistics -----------------------------\n | \ud83d\udfe2 Add 1 Resource\n | \ud83d\udd35 Modify 1 Resource\n |\n +--------------------------------------------------------------------------------\n +----------------------------------- Changes ------------------------------------\n | \ud83d\udfe2 \ud83d\udce6 Add Resource: Secret222 AWS::SecretsManager::Secret\n | \ud83d\udd35 \ud83d\udce6 Modify Resource: Secret1 AWS::SecretsManager::Secret\n | \ud83d\udd35 \ud83d\udca1 Properties: Secret1 AWS::SecretsManager::Secret.Description\n | \ud83d\udd35 \ud83d\udca1 Tags: Secret1 AWS::SecretsManager::Secret\n |\n +--------------------------------------------------------------------------------\n need to execute the change set to apply those changes.\n preview **update stack progress** at: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/stackinfo?filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false&stackId=arn:aws:cloudformation:us-east-1:111122223333:stack/cottonformation-deploy-stack-test/0c5596c0-76b4-11ed-92b1-0a0bcad48579&filteringStatus=active\n wait for deploy to finish ...\n on 3 th attempt, elapsed 15 seconds, remain 45 seconds ...\n reached status \ud83d\udfe2 'UPDATE_COMPLETE'\n done\n\n\n ============== Deploy stack: 'cottonformation-deploy-stack-test' ===============\n preview stack in AWS CloudFormation console: https://console.aws.amazon.com/cloudformation/home?#/stacks?filteringStatus=active&filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false\n preview **change set details** at: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/changesets/changes?stackId=arn:aws:cloudformation:us-east-1:111122223333:stack/cottonformation-deploy-stack-test/0c5596c0-76b4-11ed-92b1-0a0bcad48579&changeSetId=arn:aws:cloudformation:us-east-1:111122223333:changeSet/cottonformation-deploy-stack-test-2022-12-08-04-53-07-499/6edbcdf2-8e27-463f-bc5f-35587463fceb\n wait for change set creation to finish ...\n on 2 th attempt, elapsed 10 seconds, remain 50 seconds ...\n reached status CREATE_COMPLETE\n +---------------------------- Change Set Statistics -----------------------------\n | \ud83d\udfe2 Add 1 Resource\n | \ud83d\udd35 Modify 1 Resource\n | \ud83d\udd34 Remove 1 Resource\n |\n +--------------------------------------------------------------------------------\n +----------------------------------- Changes ------------------------------------\n | \ud83d\udfe2 \ud83d\udce6 Add Resource: Secret33333 AWS::SecretsManager::Secret\n | \ud83d\udd35 \ud83d\udce6 Modify Resource: Secret222 AWS::SecretsManager::Secret\n | \ud83d\udd35 \ud83d\udca1 Properties: Secret222 AWS::SecretsManager::Secret.Description\n | \ud83d\udd35 \ud83d\udca1 Metadata: Secret222 AWS::SecretsManager::Secret\n | \ud83d\udd35 \ud83d\udca1 CreationPolicy: Secret222 AWS::SecretsManager::Secret\n | \ud83d\udd35 \ud83d\udca1 UpdatePolicy: Secret222 AWS::SecretsManager::Secret\n | \ud83d\udd35 \ud83d\udca1 Tags: Secret222 AWS::SecretsManager::Secret\n | \ud83d\udd34 \ud83d\udce6 Remove Resource: Secret1 AWS::SecretsManager::Secret\n |\n +--------------------------------------------------------------------------------\n need to execute the change set to apply those changes.\n preview **update stack progress** at: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/stackinfo?filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false&stackId=arn:aws:cloudformation:us-east-1:111122223333:stack/cottonformation-deploy-stack-test/0c5596c0-76b4-11ed-92b1-0a0bcad48579&filteringStatus=active\n wait for deploy to finish ...\n on 3 th attempt, elapsed 15 seconds, remain 45 seconds ...\n reached status \ud83d\udfe2 'UPDATE_COMPLETE'\n done\n\n\n =============== Remove stack 'cottonformation-deploy-stack-test' ===============\n preview stack in AWS CloudFormation console: https://console.aws.amazon.com/cloudformation/home?#/stacks?filteringStatus=active&filteringText=cottonformation-deploy-stack-test&viewNested=true&hideStacks=false\n wait for delete to finish ...\n on 1 th attempt, elapsed 5 seconds, remain 55 seconds ...\n already deleted.\n done\n\n\n\u2b50 **CloudFormation declaration**, see `cottonformation <https://github.com/MacHu-GWU/cottonformation-project>`_:\n\n.. code-block:: python\n\n # -*- coding: utf-8 -*-\n\n import cottonformation as cf\n from cottonformation.res import secretsmanager\n\n\n def make_tpl_1() -> cf.Template:\n \"\"\"\n Create Secret1\n \"\"\"\n tpl = cf.Template()\n\n secret1 = secretsmanager.Secret(\n \"Secret1\",\n p_Name=\"aws_cft_secret1\",\n p_Description=\"This is Secret 1\",\n p_Tags=[\n cf.Tag(p_Key=\"Creator\", p_Value=\"Alice\"),\n cf.Tag(p_Key=\"Description\", p_Value=\"Hello\"),\n ]\n )\n tpl.add(secret1)\n\n return tpl\n\n\n def make_tpl_2() -> cf.Template:\n \"\"\"\n Modify Secret1\n Create Secret222\n \"\"\"\n tpl = make_tpl_1()\n\n secret1: secretsmanager.Secret = tpl.Resources[\"Secret1\"]\n secret1.p_Description = \"This must be Secret 1\"\n secret1.p_Tags = [\n cf.Tag(p_Key=\"Creator\", p_Value=\"Bob\"),\n cf.Tag(p_Key=\"Env\", p_Value=\"Dev\"),\n ]\n\n secret2 = secretsmanager.Secret(\n \"Secret222\",\n p_Name=\"aws_cft_secret2\",\n p_Description=\"This is Secret 2\",\n )\n tpl.add(secret2)\n\n output_secret2_arn = cf.Output(\n \"Secret222Arn\",\n Value=secret2.ref(),\n )\n tpl.add(output_secret2_arn)\n\n return tpl\n\n\n def make_tpl_3() -> cf.Template:\n \"\"\"\n Delete Secret1\n Modify Secret222\n Create Secret33333\n \"\"\"\n tpl = make_tpl_2()\n\n tpl.remove(tpl.Resources[\"Secret1\"])\n\n secret2: secretsmanager.Secret = tpl.Resources[\"Secret222\"]\n secret2.p_Description = \"This definitely be Secret 2\"\n secret2.p_Tags = [\n cf.Tag(p_Key=\"Creator\", p_Value=\"Cathy\"),\n cf.Tag(p_Key=\"Env\", p_Value=\"QA\"),\n ]\n secret2.ra_Metadata = {\"email\": \"cathy@email.com\"}\n\n secret3 = secretsmanager.Secret(\n \"Secret33333\",\n p_Name=\"aws_cft_secret3\",\n p_Description=\"This is Secret 3\",\n )\n tpl.add(secret3)\n\n return tpl\n\n\u2b50 **Deployment Script**:\n\n.. code-block:: python\n\n # -*- coding: utf-8 -*-\n\n from aws_cloudformation.api import deploy_stack, remove_stack\n from aws_cloudformation.tests import bsm\n from aws_cloudformation.tests.stacks.secretmanager_stack import (\n make_tpl_1,\n make_tpl_2,\n make_tpl_3,\n )\n\n stack_name = \"cottonformation-deploy-stack-test\"\n\n deploy_stack(\n bsm,\n stack_name=stack_name,\n template=make_tpl_1().to_json(),\n skip_prompt=True, # by default, it prompt user input for YES / NO to proceed\n # skip_plan=False, # by default, it does plan first\n # wait=True, # by default, it waits the update to finish\n )\n\n deploy_stack(\n bsm,\n stack_name=stack_name,\n template=make_tpl_2().to_json(),\n skip_prompt=True,\n )\n\n deploy_stack(\n bsm,\n stack_name=stack_name,\n template=make_tpl_3().to_json(),\n skip_prompt=True,\n )\n\n remove_stack(\n bsm,\n stack_name=stack_name,\n skip_prompt=True,\n )\n\n\n.. _install:\n\nInstall\n------------------------------------------------------------------------------\n\n``aws_cloudformation`` is released on PyPI, so all you need is:\n\n.. code-block:: console\n\n $ pip install aws_cloudformation\n\nTo upgrade to latest version:\n\n.. code-block:: console\n\n $ pip install --upgrade aws_cloudformation\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "\u2b50 AWS CloudFormation deployment for human, Enable terraform plan, terraform apply styled deployment.",
"version": "1.5.1",
"project_urls": {
"Download": "https://pypi.python.org/pypi/aws_cloudformation/1.5.1#downloads",
"Homepage": "https://github.com/MacHu-GWU/aws_cloudformation-project"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9bb56eb4a9c5a11bb56fd6ee1862f2bf4cb63f02e855e9057df0305a36a879f0",
"md5": "c13fa0835f2f23caa390063e67ac4cc0",
"sha256": "b363bb6528e5affee17937dfb3c2e757de6f63e6c49926756f7b40c2e32a94b3"
},
"downloads": -1,
"filename": "aws_cloudformation-1.5.1-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "c13fa0835f2f23caa390063e67ac4cc0",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 44800,
"upload_time": "2023-11-16T06:09:11",
"upload_time_iso_8601": "2023-11-16T06:09:11.529098Z",
"url": "https://files.pythonhosted.org/packages/9b/b5/6eb4a9c5a11bb56fd6ee1862f2bf4cb63f02e855e9057df0305a36a879f0/aws_cloudformation-1.5.1-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "22aa876699f849ad80acf332aa9fd753d1e98a909136f853ecad5ca4bd3946d3",
"md5": "66e099e5145892c1ea2a63434c08b056",
"sha256": "2541f48089c45a83e85ee063d3cfe6b18fdab8c67b57268341cc3017a2015b0a"
},
"downloads": -1,
"filename": "aws_cloudformation-1.5.1.tar.gz",
"has_sig": false,
"md5_digest": "66e099e5145892c1ea2a63434c08b056",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 43111,
"upload_time": "2023-11-16T06:09:13",
"upload_time_iso_8601": "2023-11-16T06:09:13.937913Z",
"url": "https://files.pythonhosted.org/packages/22/aa/876699f849ad80acf332aa9fd753d1e98a909136f853ecad5ca4bd3946d3/aws_cloudformation-1.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-16 06:09:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "MacHu-GWU",
"github_project": "aws_cloudformation-project",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"requirements": [
{
"name": "boto3",
"specs": []
},
{
"name": "boto_session_manager",
"specs": [
[
"<",
"2.0.0"
],
[
">=",
"1.3.1"
]
]
},
{
"name": "cached-property",
"specs": [
[
">=",
"1.5.2"
]
]
},
{
"name": "dataclasses",
"specs": [
[
">=",
"0.8"
]
]
},
{
"name": "aws_arns",
"specs": [
[
">=",
"1.0.1"
],
[
"<",
"2.0.0"
]
]
},
{
"name": "aws_console_url",
"specs": [
[
">=",
"1.0.1"
],
[
"<",
"2.0.0"
]
]
},
{
"name": "colorama",
"specs": [
[
"<",
"1.0.0"
],
[
">=",
"0.4.0"
]
]
},
{
"name": "light_emoji",
"specs": [
[
"<",
"1.0.0"
],
[
">=",
"0.1.1"
]
]
},
{
"name": "iterproxy",
"specs": [
[
"<",
"1.0.0"
],
[
">=",
"0.1.1"
]
]
},
{
"name": "func_args",
"specs": [
[
"<",
"1.0.0"
],
[
">=",
"0.1.1"
]
]
}
],
"tox": true,
"lcname": "aws-cloudformation"
}