Apis/Examples
examples package
================
Submodules
----------
examples.ApiGateway module
--------------------------
.. automodule:: examples.ApiGateway
:members:
:undoc-members:
:show-inheritance:
examples.ApplicationAutoScalingSample module
--------------------------------------------
.. automodule:: examples.ApplicationAutoScalingSample
:members:
:undoc-members:
:show-inheritance:
examples.ApplicationELB module
------------------------------
.. automodule:: examples.ApplicationELB
:members:
:undoc-members:
:show-inheritance:
examples.ApplicationLB\_FixedActions module
-------------------------------------------
.. automodule:: examples.ApplicationLB_FixedActions
:members:
:undoc-members:
:show-inheritance:
examples.AuroraServerlessRDS\_SecretsManager module
---------------------------------------------------
.. automodule:: examples.AuroraServerlessRDS_SecretsManager
:members:
:undoc-members:
:show-inheritance:
examples.Autoscaling module
---------------------------
.. automodule:: examples.Autoscaling
:members:
:undoc-members:
:show-inheritance:
examples.AutoscalingHTTPRequests module
---------------------------------------
.. automodule:: examples.AutoscalingHTTPRequests
:members:
:undoc-members:
:show-inheritance:
examples.Backup module
----------------------
.. automodule:: examples.Backup
:members:
:undoc-members:
:show-inheritance:
examples.Batch module
---------------------
.. automodule:: examples.Batch
:members:
:undoc-members:
:show-inheritance:
examples.CertificateManagerSample module
----------------------------------------
.. automodule:: examples.CertificateManagerSample
:members:
:undoc-members:
:show-inheritance:
examples.ClassExtensions module
-------------------------------
.. automodule:: examples.ClassExtensions
:members:
:undoc-members:
:show-inheritance:
examples.CloudFormation\_Init\_ConfigSet module
-----------------------------------------------
.. automodule:: examples.CloudFormation_Init_ConfigSet
:members:
:undoc-members:
:show-inheritance:
examples.CloudFront\_Distribution\_S3 module
--------------------------------------------
.. automodule:: examples.CloudFront_Distribution_S3
:members:
:undoc-members:
:show-inheritance:
examples.CloudFront\_StreamingDistribution\_S3 module
-----------------------------------------------------
.. automodule:: examples.CloudFront_StreamingDistribution_S3
:members:
:undoc-members:
:show-inheritance:
examples.CloudTrail module
--------------------------
.. automodule:: examples.CloudTrail
:members:
:undoc-members:
:show-inheritance:
examples.CloudWatchEventsSample module
--------------------------------------
.. automodule:: examples.CloudWatchEventsSample
:members:
:undoc-members:
:show-inheritance:
examples.CodeBuild module
-------------------------
.. automodule:: examples.CodeBuild
:members:
:undoc-members:
:show-inheritance:
examples.CodeDeploy module
--------------------------
.. automodule:: examples.CodeDeploy
:members:
:undoc-members:
:show-inheritance:
examples.CodePipeline module
----------------------------
.. automodule:: examples.CodePipeline
:members:
:undoc-members:
:show-inheritance:
examples.CustomResource module
------------------------------
.. automodule:: examples.CustomResource
:members:
:undoc-members:
:show-inheritance:
examples.Dlm module
-------------------
.. automodule:: examples.Dlm
:members:
:undoc-members:
:show-inheritance:
examples.DynamoDB\_Table module
-------------------------------
.. automodule:: examples.DynamoDB_Table
:members:
:undoc-members:
:show-inheritance:
examples.DynamoDB\_Table\_With\_GSI\_And\_NonKeyAttributes\_Projection module
-----------------------------------------------------------------------------
.. automodule:: examples.DynamoDB_Table_With_GSI_And_NonKeyAttributes_Projection
:members:
:undoc-members:
:show-inheritance:
examples.DynamoDB\_Table\_With\_GlobalSecondaryIndex module
-----------------------------------------------------------
.. automodule:: examples.DynamoDB_Table_With_GlobalSecondaryIndex
:members:
:undoc-members:
:show-inheritance:
examples.DynamoDB\_Table\_With\_KinesisStreamSpecification module
-----------------------------------------------------------------
.. automodule:: examples.DynamoDB_Table_With_KinesisStreamSpecification
:members:
:undoc-members:
:show-inheritance:
examples.DynamoDB\_Tables\_OnDemand module
------------------------------------------
.. automodule:: examples.DynamoDB_Tables_OnDemand
:members:
:undoc-members:
:show-inheritance:
examples.EC2Conditions module
-----------------------------
.. automodule:: examples.EC2Conditions
:members:
:undoc-members:
:show-inheritance:
examples.EC2InstanceSample module
---------------------------------
.. automodule:: examples.EC2InstanceSample
:members:
:undoc-members:
:show-inheritance:
examples.EC2\_Remove\_Ephemeral\_Drive module
---------------------------------------------
.. automodule:: examples.EC2_Remove_Ephemeral_Drive
:members:
:undoc-members:
:show-inheritance:
examples.ECRSample module
-------------------------
.. automodule:: examples.ECRSample
:members:
:undoc-members:
:show-inheritance:
examples.ECSCluster module
--------------------------
.. automodule:: examples.ECSCluster
:members:
:undoc-members:
:show-inheritance:
examples.ECSFargate module
--------------------------
.. automodule:: examples.ECSFargate
:members:
:undoc-members:
:show-inheritance:
examples.EFS module
-------------------
.. automodule:: examples.EFS
:members:
:undoc-members:
:show-inheritance:
examples.ELBSample module
-------------------------
.. automodule:: examples.ELBSample
:members:
:undoc-members:
:show-inheritance:
examples.EMR\_Cluster module
----------------------------
.. automodule:: examples.EMR_Cluster
:members:
:undoc-members:
:show-inheritance:
examples.ElastiCacheRedis module
--------------------------------
.. automodule:: examples.ElastiCacheRedis
:members:
:undoc-members:
:show-inheritance:
examples.ElasticBeanstalk\_Nodejs\_Sample module
------------------------------------------------
.. automodule:: examples.ElasticBeanstalk_Nodejs_Sample
:members:
:undoc-members:
:show-inheritance:
examples.ElasticsearchDomain module
-----------------------------------
.. automodule:: examples.ElasticsearchDomain
:members:
:undoc-members:
:show-inheritance:
examples.Firehose\_with\_Redshift module
----------------------------------------
.. automodule:: examples.Firehose_with_Redshift
:members:
:undoc-members:
:show-inheritance:
examples.IAM\_Policies\_SNS\_Publish\_To\_SQS module
----------------------------------------------------
.. automodule:: examples.IAM_Policies_SNS_Publish_To_SQS
:members:
:undoc-members:
:show-inheritance:
examples.IAM\_Roles\_and\_InstanceProfiles module
-------------------------------------------------
.. automodule:: examples.IAM_Roles_and_InstanceProfiles
:members:
:undoc-members:
:show-inheritance:
examples.IAM\_Users\_Groups\_and\_Policies module
-------------------------------------------------
.. automodule:: examples.IAM_Users_Groups_and_Policies
:members:
:undoc-members:
:show-inheritance:
examples.IAM\_Users\_snippet module
-----------------------------------
.. automodule:: examples.IAM_Users_snippet
:members:
:undoc-members:
:show-inheritance:
examples.IoTAnalytics module
----------------------------
.. automodule:: examples.IoTAnalytics
:members:
:undoc-members:
:show-inheritance:
examples.IoTSample module
-------------------------
.. automodule:: examples.IoTSample
:members:
:undoc-members:
:show-inheritance:
examples.Kinesis\_Stream module
-------------------------------
.. automodule:: examples.Kinesis_Stream
:members:
:undoc-members:
:show-inheritance:
examples.Lambda module
----------------------
.. automodule:: examples.Lambda
:members:
:undoc-members:
:show-inheritance:
examples.Mediapackage module
----------------------------
.. automodule:: examples.Mediapackage
:members:
:undoc-members:
:show-inheritance:
examples.Metadata module
------------------------
.. automodule:: examples.Metadata
:members:
:undoc-members:
:show-inheritance:
examples.MskCluster module
--------------------------
.. automodule:: examples.MskCluster
:members:
:undoc-members:
:show-inheritance:
examples.NatGateway module
--------------------------
.. automodule:: examples.NatGateway
:members:
:undoc-members:
:show-inheritance:
examples.NetworkLB module
-------------------------
.. automodule:: examples.NetworkLB
:members:
:undoc-members:
:show-inheritance:
examples.OpenStack\_AutoScaling module
--------------------------------------
.. automodule:: examples.OpenStack_AutoScaling
:members:
:undoc-members:
:show-inheritance:
examples.OpenStack\_Server module
---------------------------------
.. automodule:: examples.OpenStack_Server
:members:
:undoc-members:
:show-inheritance:
examples.OpsWorksSnippet module
-------------------------------
.. automodule:: examples.OpsWorksSnippet
:members:
:undoc-members:
:show-inheritance:
examples.RDS\_Snapshot\_On\_Delete module
-----------------------------------------
.. automodule:: examples.RDS_Snapshot_On_Delete
:members:
:undoc-members:
:show-inheritance:
examples.RDS\_VPC module
------------------------
.. automodule:: examples.RDS_VPC
:members:
:undoc-members:
:show-inheritance:
examples.RDS\_with\_DBParameterGroup module
-------------------------------------------
.. automodule:: examples.RDS_with_DBParameterGroup
:members:
:undoc-members:
:show-inheritance:
examples.Redshift module
------------------------
.. automodule:: examples.Redshift
:members:
:undoc-members:
:show-inheritance:
examples.RedshiftClusterInVpc module
------------------------------------
.. automodule:: examples.RedshiftClusterInVpc
:members:
:undoc-members:
:show-inheritance:
examples.Route53\_A module
--------------------------
.. automodule:: examples.Route53_A
:members:
:undoc-members:
:show-inheritance:
examples.Route53\_CNAME module
------------------------------
.. automodule:: examples.Route53_CNAME
:members:
:undoc-members:
:show-inheritance:
examples.Route53\_RoundRobin module
-----------------------------------
.. automodule:: examples.Route53_RoundRobin
:members:
:undoc-members:
:show-inheritance:
examples.S3\_Bucket module
--------------------------
.. automodule:: examples.S3_Bucket
:members:
:undoc-members:
:show-inheritance:
examples.S3\_Bucket\_With\_AccelerateConfiguration module
---------------------------------------------------------
.. automodule:: examples.S3_Bucket_With_AccelerateConfiguration
:members:
:undoc-members:
:show-inheritance:
examples.S3\_Bucket\_With\_Versioning\_And\_Lifecycle\_Rules module
-------------------------------------------------------------------
.. automodule:: examples.S3_Bucket_With_Versioning_And_Lifecycle_Rules
:members:
:undoc-members:
:show-inheritance:
examples.S3\_Website\_Bucket\_With\_Retain\_On\_Delete module
-------------------------------------------------------------
.. automodule:: examples.S3_Website_Bucket_With_Retain_On_Delete
:members:
:undoc-members:
:show-inheritance:
examples.SQSDLQ module
----------------------
.. automodule:: examples.SQSDLQ
:members:
:undoc-members:
:show-inheritance:
examples.SQSEncrypt module
--------------------------
.. automodule:: examples.SQSEncrypt
:members:
:undoc-members:
:show-inheritance:
examples.SQS\_With\_CloudWatch\_Alarms module
---------------------------------------------
.. automodule:: examples.SQS_With_CloudWatch_Alarms
:members:
:undoc-members:
:show-inheritance:
examples.SSMExample module
--------------------------
.. automodule:: examples.SSMExample
:members:
:undoc-members:
:show-inheritance:
examples.Secretsmanager module
------------------------------
.. automodule:: examples.Secretsmanager
:members:
:undoc-members:
:show-inheritance:
examples.Secretsmanager\_Rds module
-----------------------------------
.. automodule:: examples.Secretsmanager_Rds
:members:
:undoc-members:
:show-inheritance:
examples.Serverless\_Api\_Backend module
----------------------------------------
.. automodule:: examples.Serverless_Api_Backend
:members:
:undoc-members:
:show-inheritance:
examples.Serverless\_Deployment\_Preference module
--------------------------------------------------
.. automodule:: examples.Serverless_Deployment_Preference
:members:
:undoc-members:
:show-inheritance:
examples.Serverless\_S3\_Processor module
-----------------------------------------
.. automodule:: examples.Serverless_S3_Processor
:members:
:undoc-members:
:show-inheritance:
examples.VPC\_EC2\_Instance\_With\_Multiple\_Dynamic\_IPAddresses module
------------------------------------------------------------------------
.. automodule:: examples.VPC_EC2_Instance_With_Multiple_Dynamic_IPAddresses
:members:
:undoc-members:
:show-inheritance:
examples.VPC\_With\_VPN\_Connection module
------------------------------------------
.. automodule:: examples.VPC_With_VPN_Connection
:members:
:undoc-members:
:show-inheritance:
examples.VPC\_single\_instance\_in\_subnet module
-------------------------------------------------
.. automodule:: examples.VPC_single_instance_in_subnet
:members:
:undoc-members:
:show-inheritance:
examples.VpnEndpoint module
---------------------------
.. automodule:: examples.VpnEndpoint
:members:
:undoc-members:
:show-inheritance:
examples.WAF\_Common\_Attacks\_Sample module
--------------------------------------------
.. automodule:: examples.WAF_Common_Attacks_Sample
:members:
:undoc-members:
:show-inheritance:
examples.WAF\_Regional\_Common\_Attacks\_Sample module
------------------------------------------------------
.. automodule:: examples.WAF_Regional_Common_Attacks_Sample
:members:
:undoc-members:
:show-inheritance:
examples.WaitObject module
--------------------------
.. automodule:: examples.WaitObject
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: examples
:members:
:undoc-members:
:show-inheritance:
---
Apis/Tests
tests package
=============
Submodules
----------
tests.test\_apigateway module
-----------------------------
.. automodule:: tests.test_apigateway
:members:
:undoc-members:
:show-inheritance:
tests.test\_apigatewayv2 module
-------------------------------
.. automodule:: tests.test_apigatewayv2
:members:
:undoc-members:
:show-inheritance:
tests.test\_appsync module
--------------------------
.. automodule:: tests.test_appsync
:members:
:undoc-members:
:show-inheritance:
tests.test\_asg module
----------------------
.. automodule:: tests.test_asg
:members:
:undoc-members:
:show-inheritance:
tests.test\_awslambda module
----------------------------
.. automodule:: tests.test_awslambda
:members:
:undoc-members:
:show-inheritance:
tests.test\_basic module
------------------------
.. automodule:: tests.test_basic
:members:
:undoc-members:
:show-inheritance:
tests.test\_cloudformation module
---------------------------------
.. automodule:: tests.test_cloudformation
:members:
:undoc-members:
:show-inheritance:
tests.test\_cloudwatch module
-----------------------------
.. automodule:: tests.test_cloudwatch
:members:
:undoc-members:
:show-inheritance:
tests.test\_codebuild module
----------------------------
.. automodule:: tests.test_codebuild
:members:
:undoc-members:
:show-inheritance:
tests.test\_codecommit module
-----------------------------
.. automodule:: tests.test_codecommit
:members:
:undoc-members:
:show-inheritance:
tests.test\_config module
-------------------------
.. automodule:: tests.test_config
:members:
:undoc-members:
:show-inheritance:
tests.test\_dict module
-----------------------
.. automodule:: tests.test_dict
:members:
:undoc-members:
:show-inheritance:
tests.test\_ec2 module
----------------------
.. automodule:: tests.test_ec2
:members:
:undoc-members:
:show-inheritance:
tests.test\_ecr module
----------------------
.. automodule:: tests.test_ecr
:members:
:undoc-members:
:show-inheritance:
tests.test\_ecs module
----------------------
.. automodule:: tests.test_ecs
:members:
:undoc-members:
:show-inheritance:
tests.test\_efs module
----------------------
.. automodule:: tests.test_efs
:members:
:undoc-members:
:show-inheritance:
tests.test\_eks module
----------------------
.. automodule:: tests.test_eks
:members:
:undoc-members:
:show-inheritance:
tests.test\_elasticloadbalancerv2 module
----------------------------------------
.. automodule:: tests.test_elasticloadbalancerv2
:members:
:undoc-members:
:show-inheritance:
tests.test\_emr module
----------------------
.. automodule:: tests.test_emr
:members:
:undoc-members:
:show-inheritance:
tests.test\_examples module
---------------------------
.. automodule:: tests.test_examples
:members:
:undoc-members:
:show-inheritance:
tests.test\_examples\_template\_generator module
------------------------------------------------
.. automodule:: tests.test_examples_template_generator
:members:
:undoc-members:
:show-inheritance:
tests.test\_guardduty module
----------------------------
.. automodule:: tests.test_guardduty
:members:
:undoc-members:
:show-inheritance:
tests.test\_int\_type module
----------------------------
.. automodule:: tests.test_int_type
:members:
:undoc-members:
:show-inheritance:
tests.test\_logs module
-----------------------
.. automodule:: tests.test_logs
:members:
:undoc-members:
:show-inheritance:
tests.test\_mappings module
---------------------------
.. automodule:: tests.test_mappings
:members:
:undoc-members:
:show-inheritance:
tests.test\_opensearchservice module
------------------------------------
.. automodule:: tests.test_opensearchservice
:members:
:undoc-members:
:show-inheritance:
tests.test\_opsworks module
---------------------------
.. automodule:: tests.test_opsworks
:members:
:undoc-members:
:show-inheritance:
tests.test\_parameters module
-----------------------------
.. automodule:: tests.test_parameters
:members:
:undoc-members:
:show-inheritance:
tests.test\_policies module
---------------------------
.. automodule:: tests.test_policies
:members:
:undoc-members:
:show-inheritance:
tests.test\_rds module
----------------------
.. automodule:: tests.test_rds
:members:
:undoc-members:
:show-inheritance:
tests.test\_s3 module
---------------------
.. automodule:: tests.test_s3
:members:
:undoc-members:
:show-inheritance:
tests.test\_serverless module
-----------------------------
.. automodule:: tests.test_serverless
:members:
:undoc-members:
:show-inheritance:
tests.test\_sqs module
----------------------
.. automodule:: tests.test_sqs
:members:
:undoc-members:
:show-inheritance:
tests.test\_stepfunctions module
--------------------------------
.. automodule:: tests.test_stepfunctions
:members:
:undoc-members:
:show-inheritance:
tests.test\_tags module
-----------------------
.. automodule:: tests.test_tags
:members:
:undoc-members:
:show-inheritance:
tests.test\_template module
---------------------------
.. automodule:: tests.test_template
:members:
:undoc-members:
:show-inheritance:
tests.test\_template\_generator module
--------------------------------------
.. automodule:: tests.test_template_generator
:members:
:undoc-members:
:show-inheritance:
tests.test\_userdata module
---------------------------
.. automodule:: tests.test_userdata
:members:
:undoc-members:
:show-inheritance:
tests.test\_validators module
-----------------------------
.. automodule:: tests.test_validators
:members:
:undoc-members:
:show-inheritance:
tests.test\_yaml module
-----------------------
.. automodule:: tests.test_yaml
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: tests
:members:
:undoc-members:
:show-inheritance:
---
Apis/Troposphere.Helpers
troposphere.helpers package
===========================
Submodules
----------
troposphere.helpers.userdata module
-----------------------------------
.. automodule:: troposphere.helpers.userdata
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: troposphere.helpers
:members:
:undoc-members:
:show-inheritance:
---
Apis/Troposphere.Openstack
troposphere.openstack package
=============================
Submodules
----------
troposphere.openstack.heat module
---------------------------------
.. automodule:: troposphere.openstack.heat
:members:
:undoc-members:
:show-inheritance:
troposphere.openstack.neutron module
------------------------------------
.. automodule:: troposphere.openstack.neutron
:members:
:undoc-members:
:show-inheritance:
troposphere.openstack.nova module
---------------------------------
.. automodule:: troposphere.openstack.nova
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: troposphere.openstack
:members:
:undoc-members:
:show-inheritance:
---
Apis/Troposphere
troposphere package
===================
Subpackages
-----------
.. toctree::
:maxdepth: 4
troposphere.helpers
troposphere.openstack
Submodules
----------
troposphere.accessanalyzer module
---------------------------------
.. automodule:: troposphere.accessanalyzer
:members:
:undoc-members:
:show-inheritance:
troposphere.acmpca module
-------------------------
.. automodule:: troposphere.acmpca
:members:
:undoc-members:
:show-inheritance:
troposphere.amazonmq module
---------------------------
.. automodule:: troposphere.amazonmq
:members:
:undoc-members:
:show-inheritance:
troposphere.amplify module
--------------------------
.. automodule:: troposphere.amplify
:members:
:undoc-members:
:show-inheritance:
troposphere.analytics module
----------------------------
.. automodule:: troposphere.analytics
:members:
:undoc-members:
:show-inheritance:
troposphere.apigateway module
-----------------------------
.. automodule:: troposphere.apigateway
:members:
:undoc-members:
:show-inheritance:
troposphere.apigatewayv2 module
-------------------------------
.. automodule:: troposphere.apigatewayv2
:members:
:undoc-members:
:show-inheritance:
troposphere.appconfig module
----------------------------
.. automodule:: troposphere.appconfig
:members:
:undoc-members:
:show-inheritance:
troposphere.appflow module
--------------------------
.. automodule:: troposphere.appflow
:members:
:undoc-members:
:show-inheritance:
troposphere.appintegrations module
----------------------------------
.. automodule:: troposphere.appintegrations
:members:
:undoc-members:
:show-inheritance:
troposphere.applicationautoscaling module
-----------------------------------------
.. automodule:: troposphere.applicationautoscaling
:members:
:undoc-members:
:show-inheritance:
troposphere.applicationinsights module
--------------------------------------
.. automodule:: troposphere.applicationinsights
:members:
:undoc-members:
:show-inheritance:
troposphere.appmesh module
--------------------------
.. automodule:: troposphere.appmesh
:members:
:undoc-members:
:show-inheritance:
troposphere.apprunner module
----------------------------
.. automodule:: troposphere.apprunner
:members:
:undoc-members:
:show-inheritance:
troposphere.appstream module
----------------------------
.. automodule:: troposphere.appstream
:members:
:undoc-members:
:show-inheritance:
troposphere.appsync module
--------------------------
.. automodule:: troposphere.appsync
:members:
:undoc-members:
:show-inheritance:
troposphere.aps module
----------------------
.. automodule:: troposphere.aps
:members:
:undoc-members:
:show-inheritance:
troposphere.ask module
----------------------
.. automodule:: troposphere.ask
:members:
:undoc-members:
:show-inheritance:
troposphere.athena module
-------------------------
.. automodule:: troposphere.athena
:members:
:undoc-members:
:show-inheritance:
troposphere.auditmanager module
-------------------------------
.. automodule:: troposphere.auditmanager
:members:
:undoc-members:
:show-inheritance:
troposphere.autoscaling module
------------------------------
.. automodule:: troposphere.autoscaling
:members:
:undoc-members:
:show-inheritance:
troposphere.autoscalingplans module
-----------------------------------
.. automodule:: troposphere.autoscalingplans
:members:
:undoc-members:
:show-inheritance:
troposphere.awslambda module
----------------------------
.. automodule:: troposphere.awslambda
:members:
:undoc-members:
:show-inheritance:
troposphere.backup module
-------------------------
.. automodule:: troposphere.backup
:members:
:undoc-members:
:show-inheritance:
troposphere.batch module
------------------------
.. automodule:: troposphere.batch
:members:
:undoc-members:
:show-inheritance:
troposphere.budgets module
--------------------------
.. automodule:: troposphere.budgets
:members:
:undoc-members:
:show-inheritance:
troposphere.cassandra module
----------------------------
.. automodule:: troposphere.cassandra
:members:
:undoc-members:
:show-inheritance:
troposphere.ce module
---------------------
.. automodule:: troposphere.ce
:members:
:undoc-members:
:show-inheritance:
troposphere.certificatemanager module
-------------------------------------
.. automodule:: troposphere.certificatemanager
:members:
:undoc-members:
:show-inheritance:
troposphere.chatbot module
--------------------------
.. automodule:: troposphere.chatbot
:members:
:undoc-members:
:show-inheritance:
troposphere.cloud9 module
-------------------------
.. automodule:: troposphere.cloud9
:members:
:undoc-members:
:show-inheritance:
troposphere.cloudformation module
---------------------------------
.. automodule:: troposphere.cloudformation
:members:
:undoc-members:
:show-inheritance:
troposphere.cloudfront module
-----------------------------
.. automodule:: troposphere.cloudfront
:members:
:undoc-members:
:show-inheritance:
troposphere.cloudtrail module
-----------------------------
.. automodule:: troposphere.cloudtrail
:members:
:undoc-members:
:show-inheritance:
troposphere.cloudwatch module
-----------------------------
.. automodule:: troposphere.cloudwatch
:members:
:undoc-members:
:show-inheritance:
troposphere.codeartifact module
-------------------------------
.. automodule:: troposphere.codeartifact
:members:
:undoc-members:
:show-inheritance:
troposphere.codebuild module
----------------------------
.. automodule:: troposphere.codebuild
:members:
:undoc-members:
:show-inheritance:
troposphere.codecommit module
-----------------------------
.. automodule:: troposphere.codecommit
:members:
:undoc-members:
:show-inheritance:
troposphere.codedeploy module
-----------------------------
.. automodule:: troposphere.codedeploy
:members:
:undoc-members:
:show-inheritance:
troposphere.codeguruprofiler module
-----------------------------------
.. automodule:: troposphere.codeguruprofiler
:members:
:undoc-members:
:show-inheritance:
troposphere.codegurureviewer module
-----------------------------------
.. automodule:: troposphere.codegurureviewer
:members:
:undoc-members:
:show-inheritance:
troposphere.codepipeline module
-------------------------------
.. automodule:: troposphere.codepipeline
:members:
:undoc-members:
:show-inheritance:
troposphere.codestar module
---------------------------
.. automodule:: troposphere.codestar
:members:
:undoc-members:
:show-inheritance:
troposphere.codestarconnections module
--------------------------------------
.. automodule:: troposphere.codestarconnections
:members:
:undoc-members:
:show-inheritance:
troposphere.codestarnotifications module
----------------------------------------
.. automodule:: troposphere.codestarnotifications
:members:
:undoc-members:
:show-inheritance:
troposphere.cognito module
--------------------------
.. automodule:: troposphere.cognito
:members:
:undoc-members:
:show-inheritance:
troposphere.compat module
-------------------------
.. automodule:: troposphere.compat
:members:
:undoc-members:
:show-inheritance:
troposphere.config module
-------------------------
.. automodule:: troposphere.config
:members:
:undoc-members:
:show-inheritance:
troposphere.connect module
--------------------------
.. automodule:: troposphere.connect
:members:
:undoc-members:
:show-inheritance:
troposphere.constants module
----------------------------
.. automodule:: troposphere.constants
:members:
:undoc-members:
:show-inheritance:
troposphere.cur module
----------------------
.. automodule:: troposphere.cur
:members:
:undoc-members:
:show-inheritance:
troposphere.customerprofiles module
-----------------------------------
.. automodule:: troposphere.customerprofiles
:members:
:undoc-members:
:show-inheritance:
troposphere.databrew module
---------------------------
.. automodule:: troposphere.databrew
:members:
:undoc-members:
:show-inheritance:
troposphere.datapipeline module
-------------------------------
.. automodule:: troposphere.datapipeline
:members:
:undoc-members:
:show-inheritance:
troposphere.datasync module
---------------------------
.. automodule:: troposphere.datasync
:members:
:undoc-members:
:show-inheritance:
troposphere.dax module
----------------------
.. automodule:: troposphere.dax
:members:
:undoc-members:
:show-inheritance:
troposphere.detective module
----------------------------
.. automodule:: troposphere.detective
:members:
:undoc-members:
:show-inheritance:
troposphere.devopsguru module
-----------------------------
.. automodule:: troposphere.devopsguru
:members:
:undoc-members:
:show-inheritance:
troposphere.directoryservice module
-----------------------------------
.. automodule:: troposphere.directoryservice
:members:
:undoc-members:
:show-inheritance:
troposphere.dlm module
----------------------
.. automodule:: troposphere.dlm
:members:
:undoc-members:
:show-inheritance:
troposphere.dms module
----------------------
.. automodule:: troposphere.dms
:members:
:undoc-members:
:show-inheritance:
troposphere.docdb module
------------------------
.. automodule:: troposphere.docdb
:members:
:undoc-members:
:show-inheritance:
troposphere.dynamodb module
---------------------------
.. automodule:: troposphere.dynamodb
:members:
:undoc-members:
:show-inheritance:
troposphere.ec2 module
----------------------
.. automodule:: troposphere.ec2
:members:
:undoc-members:
:show-inheritance:
troposphere.ecr module
----------------------
.. automodule:: troposphere.ecr
:members:
:undoc-members:
:show-inheritance:
troposphere.ecs module
----------------------
.. automodule:: troposphere.ecs
:members:
:undoc-members:
:show-inheritance:
troposphere.efs module
----------------------
.. automodule:: troposphere.efs
:members:
:undoc-members:
:show-inheritance:
troposphere.eks module
----------------------
.. automodule:: troposphere.eks
:members:
:undoc-members:
:show-inheritance:
troposphere.elasticache module
------------------------------
.. automodule:: troposphere.elasticache
:members:
:undoc-members:
:show-inheritance:
troposphere.elasticbeanstalk module
-----------------------------------
.. automodule:: troposphere.elasticbeanstalk
:members:
:undoc-members:
:show-inheritance:
troposphere.elasticloadbalancing module
---------------------------------------
.. automodule:: troposphere.elasticloadbalancing
:members:
:undoc-members:
:show-inheritance:
troposphere.elasticloadbalancingv2 module
-----------------------------------------
.. automodule:: troposphere.elasticloadbalancingv2
:members:
:undoc-members:
:show-inheritance:
troposphere.elasticsearch module
--------------------------------
.. automodule:: troposphere.elasticsearch
:members:
:undoc-members:
:show-inheritance:
troposphere.emr module
----------------------
.. automodule:: troposphere.emr
:members:
:undoc-members:
:show-inheritance:
troposphere.emrcontainers module
--------------------------------
.. automodule:: troposphere.emrcontainers
:members:
:undoc-members:
:show-inheritance:
troposphere.events module
-------------------------
.. automodule:: troposphere.events
:members:
:undoc-members:
:show-inheritance:
troposphere.eventschemas module
-------------------------------
.. automodule:: troposphere.eventschemas
:members:
:undoc-members:
:show-inheritance:
troposphere.finspace module
---------------------------
.. automodule:: troposphere.finspace
:members:
:undoc-members:
:show-inheritance:
troposphere.firehose module
---------------------------
.. automodule:: troposphere.firehose
:members:
:undoc-members:
:show-inheritance:
troposphere.fis module
----------------------
.. automodule:: troposphere.fis
:members:
:undoc-members:
:show-inheritance:
troposphere.fms module
----------------------
.. automodule:: troposphere.fms
:members:
:undoc-members:
:show-inheritance:
troposphere.frauddetector module
--------------------------------
.. automodule:: troposphere.frauddetector
:members:
:undoc-members:
:show-inheritance:
troposphere.fsx module
----------------------
.. automodule:: troposphere.fsx
:members:
:undoc-members:
:show-inheritance:
troposphere.gamelift module
---------------------------
.. automodule:: troposphere.gamelift
:members:
:undoc-members:
:show-inheritance:
troposphere.globalaccelerator module
------------------------------------
.. automodule:: troposphere.globalaccelerator
:members:
:undoc-members:
:show-inheritance:
troposphere.glue module
-----------------------
.. automodule:: troposphere.glue
:members:
:undoc-members:
:show-inheritance:
troposphere.greengrass module
-----------------------------
.. automodule:: troposphere.greengrass
:members:
:undoc-members:
:show-inheritance:
troposphere.greengrassv2 module
-------------------------------
.. automodule:: troposphere.greengrassv2
:members:
:undoc-members:
:show-inheritance:
troposphere.groundstation module
--------------------------------
.. automodule:: troposphere.groundstation
:members:
:undoc-members:
:show-inheritance:
troposphere.guardduty module
----------------------------
.. automodule:: troposphere.guardduty
:members:
:undoc-members:
:show-inheritance:
troposphere.healthlake module
-----------------------------
.. automodule:: troposphere.healthlake
:members:
:undoc-members:
:show-inheritance:
troposphere.iam module
----------------------
.. automodule:: troposphere.iam
:members:
:undoc-members:
:show-inheritance:
troposphere.imagebuilder module
-------------------------------
.. automodule:: troposphere.imagebuilder
:members:
:undoc-members:
:show-inheritance:
troposphere.inspector module
----------------------------
.. automodule:: troposphere.inspector
:members:
:undoc-members:
:show-inheritance:
troposphere.iot module
----------------------
.. automodule:: troposphere.iot
:members:
:undoc-members:
:show-inheritance:
troposphere.iotanalytics module
-------------------------------
.. automodule:: troposphere.iotanalytics
:members:
:undoc-members:
:show-inheritance:
troposphere.iotcoredeviceadvisor module
---------------------------------------
.. automodule:: troposphere.iotcoredeviceadvisor
:members:
:undoc-members:
:show-inheritance:
troposphere.iotevents module
----------------------------
.. automodule:: troposphere.iotevents
:members:
:undoc-members:
:show-inheritance:
troposphere.iotfleethub module
------------------------------
.. automodule:: troposphere.iotfleethub
:members:
:undoc-members:
:show-inheritance:
troposphere.iotsitewise module
------------------------------
.. automodule:: troposphere.iotsitewise
:members:
:undoc-members:
:show-inheritance:
troposphere.iotwireless module
------------------------------
.. automodule:: troposphere.iotwireless
:members:
:undoc-members:
:show-inheritance:
troposphere.ivs module
----------------------
.. automodule:: troposphere.ivs
:members:
:undoc-members:
:show-inheritance:
troposphere.kendra module
-------------------------
.. automodule:: troposphere.kendra
:members:
:undoc-members:
:show-inheritance:
troposphere.kinesis module
--------------------------
.. automodule:: troposphere.kinesis
:members:
:undoc-members:
:show-inheritance:
troposphere.kinesisanalyticsv2 module
-------------------------------------
.. automodule:: troposphere.kinesisanalyticsv2
:members:
:undoc-members:
:show-inheritance:
troposphere.kms module
----------------------
.. automodule:: troposphere.kms
:members:
:undoc-members:
:show-inheritance:
troposphere.lakeformation module
--------------------------------
.. automodule:: troposphere.lakeformation
:members:
:undoc-members:
:show-inheritance:
troposphere.licensemanager module
---------------------------------
.. automodule:: troposphere.licensemanager
:members:
:undoc-members:
:show-inheritance:
troposphere.lightsail module
----------------------------
.. automodule:: troposphere.lightsail
:members:
:undoc-members:
:show-inheritance:
troposphere.location module
---------------------------
.. automodule:: troposphere.location
:members:
:undoc-members:
:show-inheritance:
troposphere.logs module
-----------------------
.. automodule:: troposphere.logs
:members:
:undoc-members:
:show-inheritance:
troposphere.lookoutequipment module
-----------------------------------
.. automodule:: troposphere.lookoutequipment
:members:
:undoc-members:
:show-inheritance:
troposphere.lookoutmetrics module
---------------------------------
.. automodule:: troposphere.lookoutmetrics
:members:
:undoc-members:
:show-inheritance:
troposphere.lookoutvision module
--------------------------------
.. automodule:: troposphere.lookoutvision
:members:
:undoc-members:
:show-inheritance:
troposphere.macie module
------------------------
.. automodule:: troposphere.macie
:members:
:undoc-members:
:show-inheritance:
troposphere.managedblockchain module
------------------------------------
.. automodule:: troposphere.managedblockchain
:members:
:undoc-members:
:show-inheritance:
troposphere.mediaconnect module
-------------------------------
.. automodule:: troposphere.mediaconnect
:members:
:undoc-members:
:show-inheritance:
troposphere.mediaconvert module
-------------------------------
.. automodule:: troposphere.mediaconvert
:members:
:undoc-members:
:show-inheritance:
troposphere.medialive module
----------------------------
.. automodule:: troposphere.medialive
:members:
:undoc-members:
:show-inheritance:
troposphere.mediapackage module
-------------------------------
.. automodule:: troposphere.mediapackage
:members:
:undoc-members:
:show-inheritance:
troposphere.mediastore module
-----------------------------
.. automodule:: troposphere.mediastore
:members:
:undoc-members:
:show-inheritance:
troposphere.memorydb module
---------------------------
.. automodule:: troposphere.memorydb
:members:
:undoc-members:
:show-inheritance:
troposphere.msk module
----------------------
.. automodule:: troposphere.msk
:members:
:undoc-members:
:show-inheritance:
troposphere.mwaa module
-----------------------
.. automodule:: troposphere.mwaa
:members:
:undoc-members:
:show-inheritance:
troposphere.neptune module
--------------------------
.. automodule:: troposphere.neptune
:members:
:undoc-members:
:show-inheritance:
troposphere.networkfirewall module
----------------------------------
.. automodule:: troposphere.networkfirewall
:members:
:undoc-members:
:show-inheritance:
troposphere.networkmanager module
---------------------------------
.. automodule:: troposphere.networkmanager
:members:
:undoc-members:
:show-inheritance:
troposphere.nimblestudio module
-------------------------------
.. automodule:: troposphere.nimblestudio
:members:
:undoc-members:
:show-inheritance:
troposphere.opensearchservice module
------------------------------------
.. automodule:: troposphere.opensearchservice
:members:
:undoc-members:
:show-inheritance:
troposphere.opsworks module
---------------------------
.. automodule:: troposphere.opsworks
:members:
:undoc-members:
:show-inheritance:
troposphere.panorama module
---------------------------
.. automodule:: troposphere.panorama
:members:
:undoc-members:
:show-inheritance:
troposphere.pinpoint module
---------------------------
.. automodule:: troposphere.pinpoint
:members:
:undoc-members:
:show-inheritance:
troposphere.pinpointemail module
--------------------------------
.. automodule:: troposphere.pinpointemail
:members:
:undoc-members:
:show-inheritance:
troposphere.policies module
---------------------------
.. automodule:: troposphere.policies
:members:
:undoc-members:
:show-inheritance:
troposphere.qldb module
-----------------------
.. automodule:: troposphere.qldb
:members:
:undoc-members:
:show-inheritance:
troposphere.quicksight module
-----------------------------
.. automodule:: troposphere.quicksight
:members:
:undoc-members:
:show-inheritance:
troposphere.ram module
----------------------
.. automodule:: troposphere.ram
:members:
:undoc-members:
:show-inheritance:
troposphere.rds module
----------------------
.. automodule:: troposphere.rds
:members:
:undoc-members:
:show-inheritance:
troposphere.redshift module
---------------------------
.. automodule:: troposphere.redshift
:members:
:undoc-members:
:show-inheritance:
troposphere.rekognition module
------------------------------
.. automodule:: troposphere.rekognition
:members:
:undoc-members:
:show-inheritance:
troposphere.resourcegroups module
---------------------------------
.. automodule:: troposphere.resourcegroups
:members:
:undoc-members:
:show-inheritance:
troposphere.robomaker module
----------------------------
.. automodule:: troposphere.robomaker
:members:
:undoc-members:
:show-inheritance:
troposphere.route53 module
--------------------------
.. automodule:: troposphere.route53
:members:
:undoc-members:
:show-inheritance:
troposphere.route53recoverycontrol module
-----------------------------------------
.. automodule:: troposphere.route53recoverycontrol
:members:
:undoc-members:
:show-inheritance:
troposphere.route53recoveryreadiness module
-------------------------------------------
.. automodule:: troposphere.route53recoveryreadiness
:members:
:undoc-members:
:show-inheritance:
troposphere.s3 module
---------------------
.. automodule:: troposphere.s3
:members:
:undoc-members:
:show-inheritance:
troposphere.s3objectlambda module
---------------------------------
.. automodule:: troposphere.s3objectlambda
:members:
:undoc-members:
:show-inheritance:
troposphere.s3outposts module
-----------------------------
.. automodule:: troposphere.s3outposts
:members:
:undoc-members:
:show-inheritance:
troposphere.sagemaker module
----------------------------
.. automodule:: troposphere.sagemaker
:members:
:undoc-members:
:show-inheritance:
troposphere.sdb module
----------------------
.. automodule:: troposphere.sdb
:members:
:undoc-members:
:show-inheritance:
troposphere.secretsmanager module
---------------------------------
.. automodule:: troposphere.secretsmanager
:members:
:undoc-members:
:show-inheritance:
troposphere.securityhub module
------------------------------
.. automodule:: troposphere.securityhub
:members:
:undoc-members:
:show-inheritance:
troposphere.serverless module
-----------------------------
.. automodule:: troposphere.serverless
:members:
:undoc-members:
:show-inheritance:
troposphere.servicecatalog module
---------------------------------
.. automodule:: troposphere.servicecatalog
:members:
:undoc-members:
:show-inheritance:
troposphere.servicecatalogappregistry module
--------------------------------------------
.. automodule:: troposphere.servicecatalogappregistry
:members:
:undoc-members:
:show-inheritance:
troposphere.servicediscovery module
-----------------------------------
.. automodule:: troposphere.servicediscovery
:members:
:undoc-members:
:show-inheritance:
troposphere.ses module
----------------------
.. automodule:: troposphere.ses
:members:
:undoc-members:
:show-inheritance:
troposphere.signer module
-------------------------
.. automodule:: troposphere.signer
:members:
:undoc-members:
:show-inheritance:
troposphere.sns module
----------------------
.. automodule:: troposphere.sns
:members:
:undoc-members:
:show-inheritance:
troposphere.sqs module
----------------------
.. automodule:: troposphere.sqs
:members:
:undoc-members:
:show-inheritance:
troposphere.ssm module
----------------------
.. automodule:: troposphere.ssm
:members:
:undoc-members:
:show-inheritance:
troposphere.ssmcontacts module
------------------------------
.. automodule:: troposphere.ssmcontacts
:members:
:undoc-members:
:show-inheritance:
troposphere.ssmincidents module
-------------------------------
.. automodule:: troposphere.ssmincidents
:members:
:undoc-members:
:show-inheritance:
troposphere.sso module
----------------------
.. automodule:: troposphere.sso
:members:
:undoc-members:
:show-inheritance:
troposphere.stepfunctions module
--------------------------------
.. automodule:: troposphere.stepfunctions
:members:
:undoc-members:
:show-inheritance:
troposphere.synthetics module
-----------------------------
.. automodule:: troposphere.synthetics
:members:
:undoc-members:
:show-inheritance:
troposphere.template\_generator module
--------------------------------------
.. automodule:: troposphere.template_generator
:members:
:undoc-members:
:show-inheritance:
troposphere.timestream module
-----------------------------
.. automodule:: troposphere.timestream
:members:
:undoc-members:
:show-inheritance:
troposphere.transfer module
---------------------------
.. automodule:: troposphere.transfer
:members:
:undoc-members:
:show-inheritance:
troposphere.utils module
------------------------
.. automodule:: troposphere.utils
:members:
:undoc-members:
:show-inheritance:
troposphere.validators module
-----------------------------
.. automodule:: troposphere.validators
:members:
:undoc-members:
:show-inheritance:
troposphere.waf module
----------------------
.. automodule:: troposphere.waf
:members:
:undoc-members:
:show-inheritance:
troposphere.wafregional module
------------------------------
.. automodule:: troposphere.wafregional
:members:
:undoc-members:
:show-inheritance:
troposphere.wafv2 module
------------------------
.. automodule:: troposphere.wafv2
:members:
:undoc-members:
:show-inheritance:
troposphere.wisdom module
-------------------------
.. automodule:: troposphere.wisdom
:members:
:undoc-members:
:show-inheritance:
troposphere.workspaces module
-----------------------------
.. automodule:: troposphere.workspaces
:members:
:undoc-members:
:show-inheritance:
troposphere.xray module
-----------------------
.. automodule:: troposphere.xray
:members:
:undoc-members:
:show-inheritance:
Module contents
---------------
.. automodule:: troposphere
:members:
:undoc-members:
:show-inheritance:
---
Index
.. troposphere documentation master file, created by
sphinx-quickstart on Fri Feb 1 14:27:25 2019.
You can adapt this file completely to your liking, but it should at least
contain the root toctree directive.
.. include:: ../README.rst
.. toctree::
:maxdepth: 2
:caption: Table of Contents
quick_start
apis/examples_toc
apis/troposphere_toc
apis/tests_toc
changelog
contributing
code_of_conduct
license
Indices and tables
==================
* :ref:genindex
* :ref:modindex
* :ref:search
---
Quick Start
Quick Start
===========
Troposphere closely follows CloudFormation, so there isn't much documentation
specific to Troposphere. In this documentation there are various examples but
for the most part the CloudFormation docs should be used.
CloudFormation Basics
---------------------
* Template Anatomy <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html>_
- structure of a CloudFormation template.
* Resources <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html>_
are the basic blocks and required in any template.
* Outputs <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html>_
are optional but can be used to create cross-stack references. Having everything
in one stack will make it very hard to manage the infrastructure. Instead,
values from one stack (for example, network setup) can be exported in this
section and imported <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-importvalue.html>_
by another stack (for example, EC2 setup). This way a stack used to set up a
certain application can be managed or deleted without affecting other
applications that might be present on the same network.
* Intrinsic Functions <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference.html>_
should be used to manipulate values that are only available at runtime. For
example, assume a template that creates a subnet and attaches a routing table
and network ACL to that subnet. The subnet doesn't exist when the template is
created, so it's ID can't be known. Instead, the route and network ACL resources
are going to get the ID at runtime, by using the
Ref <https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html>_
function against the subnet.
Basic Usage
-----------
The following two pieces of code are intended to demonstrate basic usage of
Troposphere and CloudFormation templates. First template will create two subnets
and export their IDs. The second one will create an EC2 instance in one of the
subnets. The comments explain how it works and where to find documentation
regarding the use of CloudFormation and Troposphere.
.. code:: python
#!/usr/bin/env python3
#
# learncf_subnet.py
#
# Generate a CloudFormation template that will create two subnets. This
# template exports the subnet IDs to be used by a second template which
# will create an EC2 instance in one of those subnets.
#
from troposphere import ec2
from troposphere import Tags, GetAtt, Ref, Sub, Export
from troposphere import Template, Output
# Create the object that will generate our template
t = Template()
# Define resources that CloudFormation will generate for us
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/resources-section-structure.html
# Define the first subnet. We know that 'Subnet()' is in the ec2 module
# because in CloudFormation the Subnet resource is defined under EC2:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html
net_learncf_1a = ec2.Subnet("netLearnCf1a")
# Information about the possible properties of Subnet() can be found
# in CloudFormation docs:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#aws-resource-ec2-subnet-properties
net_learncf_1a.AvailabilityZone = "eu-west-1a"
net_learncf_1a.CidrBlock = "172.30.126.80/28" # ADJUST THIS VALUE
net_learncf_1a.VpcId = "vpc-abcdefgh" # ADJUST THIS VALUE
# Tags can be declared in two ways. One way is
# (1) in AWS/boto format, as a list of dictionaries where each item in the
# list has (at least) two elements. The "Key" key will be the tag key and
# the "Value" key will be the tag's Value. Confusing, but it allows for
# additional settings to be specified for each tag. For example, if a tag
# attached to an autoscaling group should be inherited by the EC2 instances
# the group launches or not.
net_learncf_1a.Tags = [
{"Key": "Name", "Value": "learncf-1a"},
{"Key": "Comment", "Value": "CloudFormation+Troposphere test"}]
# The subnet resource defined above must be added to the template
t.add_resource(net_learncf_1a)
# The same thing can be achieved by setting parameters to Subnet() function
# instead of properties of the object created by Subnet(). Shown below.
#
# For the second subnet we use the other method of defining tags,
# (2) by using the Tags helper function, which is defined in Troposphere
# and doesn't have an equivalent in CloudFormation.
#
# Also, we use GetAtt to read the value of an attribute from a previously
# created resource, i.e. VPC ID from the first subnet. For demo purposes.
#
# The attributes returned by each resource can be found in the CloudFormation
# documentation, in the Returns section for that resource:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#aws-resource-ec2-subnet-getatt
#
# GetAtt documentation:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-getatt.html
net_learncf_1b = ec2.Subnet(
"netLearnCf1b",
AvailabilityZone="eu-west-1b",
CidrBlock="172.30.126.96/28", # ADJUST THIS VALUE
VpcId=GetAtt(net_learncf_1a, "VpcId"),
Tags=Tags(
Name="learncf-1b",
Comment="CloudFormation+Troposphere test"))
t.add_resource(net_learncf_1b)
# Outputs section will export the subnet IDs to be used by other stacks
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/outputs-section-structure.html
out_net_learncf_1a = Output("outNetLearnCf1a")
# Ref is another CloudFormation intrinsic function:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/intrinsic-function-reference-ref.html
# If pointed to a subnet, Ref will return the subnet ID:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-subnet.html#aws-resource-ec2-subnet-ref
out_net_learncf_1a.Value = Ref(net_learncf_1a)
# Append the subnet title (Logical ID) to the stack name and set that as the
# exported property. Importing it in another stack will return the Value
# we set above to that stack.
#
# Sub stands for 'substitute', another CloudFormation intrinsic function.
out_net_learncf_1a.Export = Export(Sub(
"${AWS::StackName}-" + net_learncf_1a.title))
# Similar output for the second subnet
out_net_learncf_1b = Output("outNetLearnCf1b")
out_net_learncf_1b.Value = Ref(net_learncf_1b)
out_net_learncf_1b.Export = Export(Sub(
"${AWS::StackName}-" + net_learncf_1b.title))
# Add outputs to template
t.add_output(out_net_learncf_1a)
t.add_output(out_net_learncf_1b)
# Finally, write the template to a file
with open('learncf-subnet.yaml', 'w') as f:
f.write(t.to_yaml())
And the EC2 instance template:
.. code:: python
#!/usr/bin/env python3
#
# learncf_ec2.py
#
# Generate a CloudFormation template that creates an EC2 instance in a
# subnet which was created previously by another template (learncf-subnet)
#
from troposphere import ec2
from troposphere import Tags, ImportValue
from troposphere import Template
# create the object that will generate our template
t = Template()
ec2_learncf_1a = ec2.Instance("ec2LearnCf1a")
ec2_learncf_1a.ImageId = "ami-e487179d" # ADJUST IF NEEDED
ec2_learncf_1a.InstanceType = "t2.micro"
# We set the subnet to start this instance in by importing the subnet ID
# from the other CloudFormation stack, which previously created it.
# An example of cross-stack reference used to split stacks into
# manageable pieces. Each export must have a unique name in its account
# and region, so the template name was prepended to the resource name.
ec2_learncf_1a.SubnetId = ImportValue("learncf-subnet-netLearnCf1a")
ec2_learncf_1a.Tags = Tags(
Name="learncf",
Comment="Learning CloudFormation and Troposphere")
t.add_resource(ec2_learncf_1a)
# Finally, write the template to a file
with open('learncf-ec2.yaml', 'w') as f:
f.write(t.to_yaml())
After the .yaml files are generated using the code above stacks can be created
from the command line like this:
.. code:: sh
aws cloudformation create-stack --stack-name learncf-subnet --template-body file://learncf-subnet.yaml
aws cloudformation create-stack --stack-name learncf-ec2 --template-body file://learncf-ec2.yaml
---
Requirements
awacs>=2.0.0
cfn_flip>=1.0.2
myst_parser==2.0.0
sphinx==6.2.1
sphinx_rtd_theme==1.2.2
readthedocs-sphinx-search==0.3.2
---
CONTRIBUTING
Contributing to troposphere
How to Get Help
We have a Google Group, cloudtools-dev,
where you can ask questions and engage with the troposphere community. Issues and pull requests are always
welcome!
Contributing Example Code
New example code should go into
troposphere/examples. The expectedCloudFormation Template should be stored in
troposphere/tests/examples_output/.When tests are run the output of the code in the examples directory will
be compared with the expected results in the
example_output directory.Core troposphere code base
A brief historical comment
When the project was first created each class was handcoded from the CloudFormation documentation.
Thus the code base grew organically as new validation routines and features were added. This was a
bit challenging to know what new resources and properties were added periodically from AWS.
Eventually AWS added the Resource Specification and started publishing machine readable versions but
initially it had quite a few errors and inconsistencies. An early code generator was used for adding
new resources and delta changes to existing code but still needed hand tweaking.
An updated code generator is now available but may require tweaks to handle inconsistencies or backward compatibility.
There is use of jsonpatch to handle some of these changes within the Resource Specification and the validation code has
been moved into separate code files to allow the code generator to more easily update the generated classes.
About backward compatibility
The troposphere authors strive to maintain backward compatibility within
a single major versions of this library (i.e., 2.1.0 to 2.2.0 would be backward compatible but not for 2.1.0 to 3.0.0).
However, there may be some minor breaks that occur in minor versions to correct errors, fix CloudFormation compatibility, and/or clarify usage.
Generating troposphere code
The code that gets generated is for the Resources and Properties associated with CloudFormation to help determine the type of each
property and whether it is a required field. There is other code to perform more thorough class or property validation.
To download a new Resource Specification:
make specTo generate code, the current process is roughly, scan the CloudFormation history to identify changes and then run (using S3 as an example):
python3 scripts/gen.py s3 > troposphere/s3.pyUse the auto-formatters to clean up the generated code using:
make fixVerify the changes using:
git diffFurther verification can be done via:
make lint testIf everything looks ok, further tests can be run prior to a PR such as:
make lintHandling errors in the Resource Specification
Let's walk through some of the issues that may need to be tweaked in the Resource Specification.
The application of jsonpatch changes are done by the code generator by applying all of the changes
locationed in scripts/patches looking for a patch list in each file.
Resource and Properties using the same name
The Python classes used by troposphere must have unique names. But occaisionally CloudFormation services will reuse the same name.
Here is one example of a Resource and Property needing to be renamed:
Rename AWS::IoTSiteWise::AccessPolicy.Portal to AWS::IoTSiteWise::AccessPolicy.PortalProperty due to conflict with Portal resource name
{
"op": "move",
"from": "/PropertyTypes/AWS::IoTSiteWise::AccessPolicy.Portal",
"path": "/PropertyTypes/AWS::IoTSiteWise::AccessPolicy.PortalProperty",
},
{
"op": "replace",
"path": "/PropertyTypes/AWS::IoTSiteWise::AccessPolicy.AccessPolicyResource/Properties/Portal/Type",
"value": "PortalProperty",
},The first patch will move (rename) the Property from Portal to PortalProperty.
The second patch will adjust the usage of this new name within the Property that contains it.
The above example replaces the Type field. But sometimes there is a need to use ItemType in cases where there is a List or Map of a type.
# Rename AWS::Lightsail::Instance.Disk to AWS::Lightsail::Instance.DiskProperty
{
"op": "move",
"from": "/PropertyTypes/AWS::Lightsail::Instance.Disk",
"path": "/PropertyTypes/AWS::Lightsail::Instance.DiskProperty",
},
{
"op": "replace",
"path": "/PropertyTypes/AWS::Lightsail::Instance.Hardware/Properties/Disks/ItemType",
"value": "DiskProperty",
},Backward compatibility
Early on it was not always clear what AWS wanted Resources and Properties named. These
names have been kept historically for backward compatibility (although these might change
in a future release). Thus, the names used in code generation must be maintained.
An S3 example to maintain the seage of S3Key instead of the current name S3KeyFilter.
# Rename AWS::S3::Bucket.S3KeyFilter to AWS::S3::Bucket.S3Key - backward compatibility
{
"op": "move",
"from": "/PropertyTypes/AWS::S3::Bucket.S3KeyFilter",
"path": "/PropertyTypes/AWS::S3::Bucket.S3Key",
},
# backward compatibility
{
"op": "replace",
"path": "/PropertyTypes/AWS::S3::Bucket.NotificationFilter/Properties/S3Key/Type",
"value": "S3Key",
},Same name, different property
Usually the same name for a property will be the same within the same service But occasionally this is not the case.
Thus names need to be made unique within a given service (file). In this example, FieldToMatch is used 3 times within
WAFv2 with 2 different Property contents. This renames the LoggingConfiguration FieldToMatch to LoggingConfigurationFieldToMatch.
{
"op": "move",
"from": "/PropertyTypes/AWS::WAFv2::LoggingConfiguration.FieldToMatch",
"path": "/PropertyTypes/AWS::WAFv2::LoggingConfiguration.LoggingConfigurationFieldToMatch",
},
{
"op": "replace",
"path": "/ResourceTypes/AWS::WAFv2::LoggingConfiguration/Properties/RedactedFields/ItemType",
"value": "LoggingConfigurationFieldToMatch",
},Validating types and classes
One of the core reasons to use troposphere is to help with the validation of the CloudFormation template prior to applying it into AWS.
The code generator will usually do type validation to ensure the correct type is used for a property and tje required field which will
warn if there are missing required fields. The other validators allow for functions to do further type and value validation along with
class validation.
Property type function validators
For some primitive types (Boolean, Integer, Double, String), the code generator will insert a type validator automatically.
This helps ensure the given value can be coerced into a the correct type. Here are two examples for boolean and integer validation:
def boolean(x):
if x in [True, 1, "1", "true", "True"]:
return True
if x in [False, 0, "0", "false", "False"]:
return False
raise ValueError
def integer(x):
try:
int(x)
except (ValueError, TypeError):
raise ValueError("%r is not a valid integer" % x)
else:
return x
Another one is to verfify a network port is an integer and checks for either -1 or the port to be between 0 and 65535:
def network_port(x):
from .. import AWSHelperFn # Network ports can be Ref items
if isinstance(x, AWSHelperFn):
return x
i = integer(x)
if int(i) < -1 or int(i) > 65535:
raise ValueError("network port %r must been between 0 and 65535" % i)
return x
Most properties can have a helper function (If, FindInMap, Ref, etc.) so there is a check for those included.
Property value function validators
Another use of validators is to ensure the value is correct. This is usually fields that accept a limited set
of strings for their value. Here is an example for
AWS::S3::Bucket AccelerateConfiguration
which requires the field to be either "Enabled" or "Suspended":
def s3_transfer_acceleration_status(value):
"""
Property: AccelerateConfiguration.AccelerationStatus
"""
valid_status = ["Enabled", "Suspended"]
if value not in valid_status:
raise ValueError(
'AccelerationStatus must be one of: "%s"' % (", ".join(valid_status))
)
return valueIn the past these validators were included in the main code base (troposphere/*.py) but are now located introposphere/validators directory with corresponding names (troposphere/validators/s3.py) in the case of the above.
Note the docstring contains Property: AccelerateConfiguration.AccelerationStatus which is parse by the code generator
to apply this validator to the correct Property. This can be used multiple times since the same validator could apply in
several different places.
Class function validators
A class function validator will usually look at several different properties to determine if the class is valid.
As mentioned above, these used to be in the main code but are now in the validation directory.
Some simple examples from CodeDeploy:
The LoadBalancerInfo property must have either an ElbInfoList or TargetGroupInfoList defined.
def validate_load_balancer_info(self):
"""
Class: LoadBalancerInfo
"""
conds = ["ElbInfoList", "TargetGroupInfoList"]
exactly_one(self.__class__.__name__, self.properties, conds)This shows where fields must be mutually exclusive.
def validate_deployment_group(self):
"""
Class: DeploymentGroup
"""
ec2_conds = ["EC2TagFilters", "Ec2TagSet"]
onPremises_conds = ["OnPremisesInstanceTagFilters", "OnPremisesTagSet"]
mutually_exclusive(self.__class__.__name__, self.properties, ec2_conds)
mutually_exclusive(self.__class__.__name__, self.properties, onPremises_conds)---