Skip to main content

AWS CloudFormation Resource Provider Python Plugin

The CloudFormation CLI (cfn) allows you to author your own resource providers that can be used by CloudFormation.

This plugin library helps to provide Python runtime bindings for the execution of your providers by CloudFormation.

AWS CloudFormation Resource Provider Python Plugin

The CloudFormation Resource Provider Development Kit (RPDK) allows you to author your own resource providers that can be used by CloudFormation.

This plugin library helps to provide runtime bindings for the execution of your providers by CloudFormation.

Build Status

Community

Join us on Discord! Connect & interact with CloudFormation developers & experts, find channels to discuss and get help for our CLIs, cfn-lint, CloudFormation registry, StackSets, Guard and more:

Join our Discord

Installation

pip install cloudformation-cli-python-plugin

Howto

$ cfn init
Initializing new project
What's the name of your resource type?
(Organization::Service::Resource)
>> Foo::Bar::Baz
Select a language for code generation:
[1] java
[2] csharp
[3] python38
[4] python39
[5] python310
[6] python311
[7] python312
(enter an integer):
>> 4
Use docker for platform-independent packaging (Y/n)?
This is highly recommended unless you are experienced
with cross-platform Python packaging.
>> y
Initialized a new project in <>
$ cfn submit --dry-run
$ cat <<EOT > test.json
{
  "credentials": {
    "accessKeyId": "",
    "secretAccessKey": "",
    "sessionToken": ""
  },
  "action": "CREATE",
  "request": {
    "clientRequestToken": "ecba020e-b2e6-4742-a7d0-8a06ae7c4b2b",
    "desiredResourceState": {
      "Title": "This_Is_The_Title_For_My_Example",
      "TestCode": "NOT_STARTED"
    },
    "previousResourceState": null,
    "logicalResourceIdentifier": null
  },
  "callbackContext": null
}
EOT
$ sam local invoke TestEntrypoint --event test.json

Development

For changes to the plugin, a Python virtual environment is recommended. The development requirements can be sourced from the core repository:

python3 -m venv env
source env/bin/activate
pip install -e . -e src/ \
  -r https://raw.githubusercontent.com/aws-cloudformation/aws-cloudformation-rpdk/master/requirements.txt
pre-commit install

Linting and running unit tests is done via pre-commit, and so is performed automatically on commit. The continuous integration also runs these checks. Manual options are available so you don't have to commit):

# run all hooks on all files, mirrors what the CI runs
pre-commit run --all-files
# run unit tests only. can also be used for other hooks, e.g. black, flake8, pylint-local
pre-commit run pytest-local

License

This library is licensed under the Apache 2.0 License.

Release files for cloudformation-cli-python-plugin 2.1.10

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloudformation-cli-python-plugin 2.1.10
File Size Uploaded
cloudformation-cli-python-plugin-2.1.10.tar.gz 17.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cloudformation-cli-python-plugin 2.1.10
File Interpreter ABI Platform
cloudformation_cli_python_plugin-2.1.10-py3-none-any.whl Python 3 none any Details

Total release size: 39.5 kB

Release files / cloudformation-cli-python-plugin-2.1.10.tar.gz

Download URL cloudformation-cli-python-plugin-2.1.10.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3883751baaa1c6f9778e946e2758f129b7276b9192e21f921fc815b0765961d6
BLAKE2b-256 checksum
How to use checksums
aef1bd758290777dd9b87b2ffebd9b4271a95188aed0acb9f6bc44af940ccb31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release files / cloudformation_cli_python_plugin-2.1.10-py3-none-any.whl

Download URL cloudformation_cli_python_plugin-2.1.10-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a2a297ed717fef221f6e1c663b80be30763507ca2f34734794e25f58d2f1c7e1
BLAKE2b-256 checksum
How to use checksums
b64c8e6f5b6157db1ca8501f49e6ddcba831f94bdebe1c3774743284a250f5a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.21

Release history Release notifications | RSS feed

This release

2.1.10 This release

2 release files

2.1.9

2 release files

2.1.8

2 release files

2.1.7

2 release files

2.1.6

2 release files

2.1.5

2 release files

2.1.4

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page