Skip to main content

Type annotations for boto3.CloudFormation 1.14.47 service, generated by mypy-boto3-buider 2.2.0

Project description

mypy-boto3-cloudformation

PyPI - mypy-boto3-cloudformation PyPI - Python Version Docs

Type annotations for boto3.CloudFormation 1.14.47 service compatible with mypy, VSCode, PyCharm and other tools.

Generated by mypy-boto3-buider 2.2.0.

More information can be found on boto3-stubs page.

How to install

Make sure you have mypy installed and activated in your IDE.

Install boto3-stubs for CloudFormation service.

python -m pip install boto3-stubs[cloudformation]

How to use

Client annotations

CloudFormationClient provides annotations for boto3.client("cloudformation").

import boto3

from mypy_boto3_cloudformation import CloudFormationClient, CloudFormationServiceResource
from mypy_boto3_cloudformation.paginator import (
    DescribeAccountLimitsPaginator,
    DescribeChangeSetPaginator,
    DescribeStackEventsPaginator,
    DescribeStacksPaginator,
    ListChangeSetsPaginator,
    ListExportsPaginator,
    ListImportsPaginator,
    ListStackInstancesPaginator,
    ListStackResourcesPaginator,
    ListStackSetOperationResultsPaginator,
    ListStackSetOperationsPaginator,
    ListStackSetsPaginator,
    ListStacksPaginator,
)
from mypy_boto3_cloudformation.service_resource import (
    Event,
    ServiceResourceStacksCollection,
    Stack,
    StackResource,
    StackResourceSummary,
)
from mypy_boto3_cloudformation.type_defs import AccountGateResultTypeDef, ...
from mypy_boto3_cloudformation.waiter import (
    ChangeSetCreateCompleteWaiter,
    StackCreateCompleteWaiter,
    StackDeleteCompleteWaiter,
    StackExistsWaiter,
    StackImportCompleteWaiter,
    StackRollbackCompleteWaiter,
    StackUpdateCompleteWaiter,
    TypeRegistrationCompleteWaiter,
)

client: CloudFormationClient = boto3.client("cloudformation")

# now client usage is checked by mypy and IDE should provide code auto-complete

# works for session as well
session = boto3.session.Session(region="us-west-1")
session_client: CloudFormationClient = session.client("cloudformation")

Paginators annotations

mypy_boto3_cloudformation.paginator module contains type annotations for all paginators.

client: CloudFormationClient = boto3.client("cloudformation")

# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
# VSCode requires explicit type annotations
describe_account_limits_paginator: DescribeAccountLimitsPaginator = client.get_paginator("describe_account_limits")
describe_change_set_paginator: DescribeChangeSetPaginator = client.get_paginator("describe_change_set")
describe_stack_events_paginator: DescribeStackEventsPaginator = client.get_paginator("describe_stack_events")
describe_stacks_paginator: DescribeStacksPaginator = client.get_paginator("describe_stacks")
list_change_sets_paginator: ListChangeSetsPaginator = client.get_paginator("list_change_sets")
list_exports_paginator: ListExportsPaginator = client.get_paginator("list_exports")
list_imports_paginator: ListImportsPaginator = client.get_paginator("list_imports")
list_stack_instances_paginator: ListStackInstancesPaginator = client.get_paginator("list_stack_instances")
list_stack_resources_paginator: ListStackResourcesPaginator = client.get_paginator("list_stack_resources")
list_stack_set_operation_results_paginator: ListStackSetOperationResultsPaginator = client.get_paginator("list_stack_set_operation_results")
list_stack_set_operations_paginator: ListStackSetOperationsPaginator = client.get_paginator("list_stack_set_operations")
list_stack_sets_paginator: ListStackSetsPaginator = client.get_paginator("list_stack_sets")
list_stacks_paginator: ListStacksPaginator = client.get_paginator("list_stacks")

Waiters annotations

mypy_boto3_cloudformation.waiter module contains type annotations for all waiters.

client: CloudFormationClient = boto3.client("cloudformation")

# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
# VSCode requires explicit type annotations
change_set_create_complete_waiter: ChangeSetCreateCompleteWaiter = client.get_waiter("change_set_create_complete")
stack_create_complete_waiter: StackCreateCompleteWaiter = client.get_waiter("stack_create_complete")
stack_delete_complete_waiter: StackDeleteCompleteWaiter = client.get_waiter("stack_delete_complete")
stack_exists_waiter: StackExistsWaiter = client.get_waiter("stack_exists")
stack_import_complete_waiter: StackImportCompleteWaiter = client.get_waiter("stack_import_complete")
stack_rollback_complete_waiter: StackRollbackCompleteWaiter = client.get_waiter("stack_rollback_complete")
stack_update_complete_waiter: StackUpdateCompleteWaiter = client.get_waiter("stack_update_complete")
type_registration_complete_waiter: TypeRegistrationCompleteWaiter = client.get_waiter("type_registration_complete")

Service Resource annotations

CloudFormationServiceResource provides annotations for boto3.resource("cloudformation").

resource: CloudFormationServiceResource = boto3.resource("cloudformation")

# now resource usage is checked by mypy and IDE should provide code auto-complete

# works for session as well
session = boto3.session.Session(region="us-west-1")
session_resource: CloudFormationServiceResource = session.resource("cloudformation")

Other resources annotations

mypy_boto3_cloudformation.service_resource module contains type annotations for all resources.

resource: CloudFormationServiceResource = boto3.resource("cloudformation")

# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
my_event: Event = resource.Event(...)
my_stack: Stack = resource.Stack(...)
my_stack_resource: StackResource = resource.StackResource(...)
my_stack_resource_summary: StackResourceSummary = resource.StackResourceSummary(...)

Collections annotations

mypy_boto3_cloudformation.service_resource module contains type annotations for all CloudFormationServiceResource collections.

resource: CloudFormationServiceResource = boto3.resource("cloudformation")

# Explicit type annotations are optional here
# Type should be correctly discovered by mypy and IDEs
stacks: cloudformation_resources.ServiceResourceStacksCollection = resource.stacks

Typed dictionations

mypy_boto3_cloudformation.type_defs module contains structures and shapes assembled to typed dictionaries for additional type checking.

def get_structure() -> AccountGateResultTypeDef:
    return {
      ...
    }

Dynamic type annotations

mypy_boto3 command generates boto3.client/resource type annotations for mypy_boto3_cloudformation and other installed services.

# Run this command after you add or remove service packages
python -m mypy_boto3

Generated type annotations provide overloads for boto3.client and boto3.resource, boto3.Session.client and boto3.Session.resource functions, so explicit type annotations are not needed.

  • mypy supports function overloads as expected
  • PyCharm also supports function overloads, but consumes a lot of RAM, use carefully if you have many services installed
  • VSCode does not currently support function overloads, use explicit type annotations
# Type is discovered correctly by mypy and PyCharm
# VSCode still needs explicit type annotations
client = boto3.client("cloudformation")
resource = boto3.resource("cloudformation")

session_client = boto3.Session().client("cloudformation")
session_resource = boto3.Session().resource("cloudformation")

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mypy-boto3-cloudformation-1.14.47.0.tar.gz (18.8 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page