Bases: CfnResource
A CloudFormation AWS::Serverless::StateMachine
.
AWS::Serverless::StateMachine
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
# definition: Any
cfn_state_machine = sam.CfnStateMachine(self, "MyCfnStateMachine",
definition=definition,
definition_substitutions={
"definition_substitutions_key": "definitionSubstitutions"
},
definition_uri="definitionUri",
events={
"events_key": sam.CfnStateMachine.EventSourceProperty(
properties=sam.CfnStateMachine.CloudWatchEventEventProperty(
method="method",
path="path",
# the properties below are optional
rest_api_id="restApiId"
),
type="type"
)
},
logging=sam.CfnStateMachine.LoggingConfigurationProperty(
destinations=[sam.CfnStateMachine.LogDestinationProperty(
cloud_watch_logs_log_group=sam.CfnStateMachine.CloudWatchLogsLogGroupProperty(
log_group_arn="logGroupArn"
)
)],
include_execution_data=False,
level="level"
),
name="name",
permissions_boundaries="permissionsBoundaries",
policies="policies",
role="role",
tags={
"tags_key": "tags"
},
tracing=sam.CfnStateMachine.TracingConfigurationProperty(
enabled=False
),
type="type"
)
Create a new AWS::Serverless::StateMachine
.
scope (Construct
) –
scope in which this resource is defined.
id (str
) –
scoped id of the resource.
definition (Optional
[Any
]) – AWS::Serverless::StateMachine.Definition
.
definition_substitutions (Union
[IResolvable
, Mapping
[str
, str
], None
]) – AWS::Serverless::StateMachine.DefinitionSubstitutions
.
definition_uri (Union
[str
, IResolvable
, S3LocationProperty
, Dict
[str
, Any
], None
]) – AWS::Serverless::StateMachine.DefinitionUri
.
events (Union
[IResolvable
, Mapping
[str
, Union
[IResolvable
, EventSourceProperty
, Dict
[str
, Any
]]], None
]) – AWS::Serverless::StateMachine.Events
.
logging (Union
[IResolvable
, LoggingConfigurationProperty
, Dict
[str
, Any
], None
]) – AWS::Serverless::StateMachine.Logging
.
name (Optional
[str
]) – AWS::Serverless::StateMachine.Name
.
permissions_boundaries (Optional
[str
]) – AWS::Serverless::StateMachine.PermissionsBoundaries
.
policies (Union
[str
, IResolvable
, IAMPolicyDocumentProperty
, Dict
[str
, Any
], Sequence
[Union
[str
, IResolvable
, IAMPolicyDocumentProperty
, Dict
[str
, Any
], SAMPolicyTemplateProperty
]], None
]) – AWS::Serverless::StateMachine.Policies
.
role (Optional
[str
]) – AWS::Serverless::StateMachine.Role
.
tags (Optional
[Mapping
[str
, str
]]) – AWS::Serverless::StateMachine.Tags
.
tracing (Union
[IResolvable
, TracingConfigurationProperty
, Dict
[str
, Any
], None
]) – AWS::Serverless::StateMachine.Tracing
.
type (Optional
[str
]) – AWS::Serverless::StateMachine.Type
.
Methods
Syntactic sugar for addOverride(path, undefined)
.
path (str
) – The path of the value to delete.
None
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
target (CfnResource
)
None
Add a value to the CloudFormation Resource Metadata.
key (str
)
value (Any
)
None
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use addPropertyOverride
or prefix path
with
“Properties.” (i.e. Properties.TopicName
).
If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal .
in the property name, prefix with a \
. In most
programming languages you will need to write this as "\\."
because the
\
itself will need to be escaped.
For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"])
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
The value
argument to addOverride
will not be processed or translated
in any way. Pass raw JSON values in here with the correct capitalization
for CloudFormation. If you pass CDK classes or structs, they will be
rendered with lowercased key names, and CloudFormation will reject the
template.
path (str
) –
The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
value (Any
) –
The value. Could be primitive or complex.
None
Adds an override that deletes the value of a property from the resource definition.
property_path (str
) – The path to the property.
None
Adds an override to a resource property.
Syntactic sugar for addOverride("Properties.<...>", value)
.
property_path (str
) – The path of the property.
value (Any
) – The value.
None
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
).
policy (Optional
[RemovalPolicy
])
apply_to_update_replace_policy (Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: true
default (Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.
None
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. resource.arn
), but this can be used for future compatibility
in case there is no generated attribute.
attribute_name (str
) – The name of the attribute.
Retrieve a value value from the CloudFormation Resource Metadata.
key (str
)
Any
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
Examines the CloudFormation resource and discloses attributes.
inspector (TreeInspector
) –
tree inspector to collect and process attributes.
None
Overrides the auto-generated logical ID with a specific ID.
new_logical_id (str
) – The new logical ID to use for this stack element.
None
Returns a string representation of this construct.
str
a string representation of this resource
Attributes
Options for this resource, such as condition, update policy etc.
AWS resource type.
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
AWS::Serverless::StateMachine.Definition
.
AWS::Serverless::StateMachine.DefinitionSubstitutions
.
AWS::Serverless::StateMachine.DefinitionUri
.
AWS::Serverless::StateMachine.Events
.
AWS::Serverless::StateMachine.Logging
.
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use overrideLogicalId(newLogicalId)
.
the logical ID as a stringified token. This value will only get resolved during synthesis.
AWS::Serverless::StateMachine.Name
.
The construct tree node associated with this construct.
AWS::Serverless::StateMachine.PermissionsBoundaries
.
AWS::Serverless::StateMachine.Policies
.
Return a string that will be resolved to a CloudFormation { Ref }
for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through Lazy.any({ produce: resource.ref })
.
AWS::Serverless::StateMachine.Role
.
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
AWS::Serverless::StateMachine.Tags
.
AWS::Serverless::StateMachine.Tracing
.
AWS::Serverless::StateMachine.Type
.
Static Methods
Returns true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).
Uses duck-typing instead of instanceof
to allow stack elements from different
versions of this library to be included in the same stack.
x (Any
)
bool
The construct as a stack element or undefined if it is not a stack element.
Check whether the given construct is a CfnResource.
construct (IConstruct
)
bool
Return whether the given object is a Construct.
x (Any
)
bool
Bases: object
method (str
) – CfnStateMachine.ApiEventProperty.Method
.
path (str
) – CfnStateMachine.ApiEventProperty.Path
.
rest_api_id (Optional
[str
]) – CfnStateMachine.ApiEventProperty.RestApiId
.
https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
api_event_property = sam.CfnStateMachine.ApiEventProperty(
method="method",
path="path",
# the properties below are optional
rest_api_id="restApiId"
)
Attributes
CfnStateMachine.ApiEventProperty.Method
.
CfnStateMachine.ApiEventProperty.Path
.
CfnStateMachine.ApiEventProperty.RestApiId
.
Bases: object
pattern (Any
) – CfnStateMachine.CloudWatchEventEventProperty.Pattern
.
event_bus_name (Optional
[str
]) – CfnStateMachine.CloudWatchEventEventProperty.EventBusName
.
input (Optional
[str
]) – CfnStateMachine.CloudWatchEventEventProperty.Input
.
input_path (Optional
[str
]) – CfnStateMachine.CloudWatchEventEventProperty.InputPath
.
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
# pattern: Any
cloud_watch_event_event_property = sam.CfnStateMachine.CloudWatchEventEventProperty(
pattern=pattern,
# the properties below are optional
event_bus_name="eventBusName",
input="input",
input_path="inputPath"
)
Attributes
CfnStateMachine.CloudWatchEventEventProperty.EventBusName
.
CfnStateMachine.CloudWatchEventEventProperty.Input
.
CfnStateMachine.CloudWatchEventEventProperty.InputPath
.
CfnStateMachine.CloudWatchEventEventProperty.Pattern
.
Bases: object
log_group_arn (str
) – CfnStateMachine.CloudWatchLogsLogGroupProperty.LogGroupArn
.
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
cloud_watch_logs_log_group_property = sam.CfnStateMachine.CloudWatchLogsLogGroupProperty(
log_group_arn="logGroupArn"
)
Attributes
CfnStateMachine.CloudWatchLogsLogGroupProperty.LogGroupArn
.
Bases: object
pattern (Any
) – CfnStateMachine.EventBridgeRuleEventProperty.Pattern
.
event_bus_name (Optional
[str
]) – CfnStateMachine.EventBridgeRuleEventProperty.EventBusName
.
input (Optional
[str
]) – CfnStateMachine.EventBridgeRuleEventProperty.Input
.
input_path (Optional
[str
]) – CfnStateMachine.EventBridgeRuleEventProperty.InputPath
.
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
# pattern: Any
event_bridge_rule_event_property = sam.CfnStateMachine.EventBridgeRuleEventProperty(
pattern=pattern,
# the properties below are optional
event_bus_name="eventBusName",
input="input",
input_path="inputPath"
)
Attributes
CfnStateMachine.EventBridgeRuleEventProperty.EventBusName
.
CfnStateMachine.EventBridgeRuleEventProperty.Input
.
CfnStateMachine.EventBridgeRuleEventProperty.InputPath
.
CfnStateMachine.EventBridgeRuleEventProperty.Pattern
.
Bases: object
properties (Union
[IResolvable
, ApiEventProperty
, Dict
[str
, Any
], CloudWatchEventEventProperty
, EventBridgeRuleEventProperty
, ScheduleEventProperty
]) – CfnStateMachine.EventSourceProperty.Properties
.
type (str
) – CfnStateMachine.EventSourceProperty.Type
.
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
event_source_property = sam.CfnStateMachine.EventSourceProperty(
properties=sam.CfnStateMachine.CloudWatchEventEventProperty(
method="method",
path="path",
# the properties below are optional
rest_api_id="restApiId"
),
type="type"
)
Attributes
CfnStateMachine.EventSourceProperty.Properties
.
CfnStateMachine.EventSourceProperty.Type
.
Bases: object
function_name (str
) – CfnStateMachine.FunctionSAMPTProperty.FunctionName
.
https://github.com/awslabs/serverless-application-model/blob/master/docs/policy_templates.rst
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
function_sAMPTProperty = sam.CfnStateMachine.FunctionSAMPTProperty(
function_name="functionName"
)
Attributes
CfnStateMachine.FunctionSAMPTProperty.FunctionName
.
Bases: object
statement (Any
) – CfnStateMachine.IAMPolicyDocumentProperty.Statement
.
version (str
) – CfnStateMachine.IAMPolicyDocumentProperty.Version
.
http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
# statement: Any
i_aMPolicy_document_property = {
"statement": statement,
"version": "version"
}
Attributes
CfnStateMachine.IAMPolicyDocumentProperty.Statement
.
CfnStateMachine.IAMPolicyDocumentProperty.Version
.
Bases: object
cloud_watch_logs_log_group (Union
[IResolvable
, CloudWatchLogsLogGroupProperty
, Dict
[str
, Any
]]) – CfnStateMachine.LogDestinationProperty.CloudWatchLogsLogGroup
.
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
log_destination_property = sam.CfnStateMachine.LogDestinationProperty(
cloud_watch_logs_log_group=sam.CfnStateMachine.CloudWatchLogsLogGroupProperty(
log_group_arn="logGroupArn"
)
)
Attributes
CfnStateMachine.LogDestinationProperty.CloudWatchLogsLogGroup
.
Bases: object
destinations (Union
[IResolvable
, Sequence
[Union
[IResolvable
, LogDestinationProperty
, Dict
[str
, Any
]]]]) – CfnStateMachine.LoggingConfigurationProperty.Destinations
.
include_execution_data (Union
[bool
, IResolvable
]) – CfnStateMachine.LoggingConfigurationProperty.IncludeExecutionData
.
level (str
) – CfnStateMachine.LoggingConfigurationProperty.Level
.
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
logging_configuration_property = sam.CfnStateMachine.LoggingConfigurationProperty(
destinations=[sam.CfnStateMachine.LogDestinationProperty(
cloud_watch_logs_log_group=sam.CfnStateMachine.CloudWatchLogsLogGroupProperty(
log_group_arn="logGroupArn"
)
)],
include_execution_data=False,
level="level"
)
Attributes
CfnStateMachine.LoggingConfigurationProperty.Destinations
.
CfnStateMachine.LoggingConfigurationProperty.IncludeExecutionData
.
CfnStateMachine.LoggingConfigurationProperty.Level
.
Bases: object
bucket (str
) – CfnStateMachine.S3LocationProperty.Bucket
.
key (str
) – CfnStateMachine.S3LocationProperty.Key
.
version (Union
[int
, float
, None
]) – CfnStateMachine.S3LocationProperty.Version
.
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
s3_location_property = sam.CfnStateMachine.S3LocationProperty(
bucket="bucket",
key="key",
# the properties below are optional
version=123
)
Attributes
CfnStateMachine.S3LocationProperty.Bucket
.
CfnStateMachine.S3LocationProperty.Key
.
CfnStateMachine.S3LocationProperty.Version
.
Bases: object
lambda_invoke_policy (Union
[IResolvable
, FunctionSAMPTProperty
, Dict
[str
, Any
], None
]) – CfnStateMachine.SAMPolicyTemplateProperty.LambdaInvokePolicy
.
step_functions_execution_policy (Union
[IResolvable
, StateMachineSAMPTProperty
, Dict
[str
, Any
], None
]) – CfnStateMachine.SAMPolicyTemplateProperty.StepFunctionsExecutionPolicy
.
https://github.com/awslabs/serverless-application-model/blob/master/docs/policy_templates.rst
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
s_aMPolicy_template_property = sam.CfnStateMachine.SAMPolicyTemplateProperty(
lambda_invoke_policy=sam.CfnStateMachine.FunctionSAMPTProperty(
function_name="functionName"
),
step_functions_execution_policy=sam.CfnStateMachine.StateMachineSAMPTProperty(
state_machine_name="stateMachineName"
)
)
Attributes
CfnStateMachine.SAMPolicyTemplateProperty.LambdaInvokePolicy
.
CfnStateMachine.SAMPolicyTemplateProperty.StepFunctionsExecutionPolicy
.
Bases: object
schedule (str
) – CfnStateMachine.ScheduleEventProperty.Schedule
.
input (Optional
[str
]) – CfnStateMachine.ScheduleEventProperty.Input
.
https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#schedule
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
schedule_event_property = sam.CfnStateMachine.ScheduleEventProperty(
schedule="schedule",
# the properties below are optional
input="input"
)
Attributes
CfnStateMachine.ScheduleEventProperty.Input
.
CfnStateMachine.ScheduleEventProperty.Schedule
.
Bases: object
state_machine_name (str
) – CfnStateMachine.StateMachineSAMPTProperty.StateMachineName
.
https://github.com/awslabs/serverless-application-model/blob/master/docs/policy_templates.rst
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
state_machine_sAMPTProperty = sam.CfnStateMachine.StateMachineSAMPTProperty(
state_machine_name="stateMachineName"
)
Attributes
CfnStateMachine.StateMachineSAMPTProperty.StateMachineName
.
Bases: object
enabled (Union
[bool
, IResolvable
, None
]) – CfnStateMachine.TracingConfigurationProperty.Enabled
.
https://github.com/awslabs/serverless-application-model/blob/master/versions/2016-10-31.md#api
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_sam as sam
tracing_configuration_property = sam.CfnStateMachine.TracingConfigurationProperty(
enabled=False
)
Attributes
CfnStateMachine.TracingConfigurationProperty.Enabled
.