Attini Deployment Plan
The Attini deployment plan is an abstraction on the AWS::Serverless::StateMachine CloudFormation resource. It also extends the StateMachine with features that make it an excellent deployment orchestrator. It integrates with the deployment source files, the Attini CLI, and supports the Attini State Types.
You can define your deployment plan in a programming language using the Attini CDK Constructs.
The deployment plan can ONLY be created in the Attini init deploy stack.
The deployment plan template requires the following Transform configuration:
AWSTemplateFormatVersion: "2010-09-09"
Transform:
- AttiniDeploymentPlan
- AWS::Serverless-2016-10-31
Attini::Deploy::DeploymentPlan
Type: Attini::Deploy::DeploymentPlan
Properties:
DefinitionSubstitutions: Map
PayloadDefaults: Map
RoleArn: String
Policies: String | List | Map
PermissionsBoundary: String
Tags: Map<String,String>
DefaultRunner: String
DeploymentPlan: DeploymentPlan Definition
Type: Map<String,String|Map>
AWS SAM compatibility: This property is passed directly to the DefinitionSubstitutions property of an AWS::Serverless::StateMachine resource.
This is useful if you want to use AWS CloudFormations Condition functions when you build your deployment plan. This can also be used for Intrinsic functions but most of them (ex Fn::Sub and Ref) can also be written straight in the deployment plan.
Required: No
Type: Map<String,String|Map>
A method to create initial default values for the deployment payload.
These default values can be used to avoid runtime errors when reading missing values from the payload.
The PayloadDefaults currently only work in the “output” section of the payload.
Example
Properties:
PayloadDefaults:
output:
MyStepName:
MyOutput: "MyValue"
This value can be referenced in DeploymentPlan with the JSON
string: $.output.MyStepName.MyOutput
.
MyValue
can be overwritten by a step called MyStepName
if it
outputs a key called MyOutput
.
Required: No
Type: String
AWS SAM compatibility: This property is passed directly to the Role property of an AWS::Serverless::StateMachine resource.
You provide either a RoleArn or Policies.
Default: arn:aws:iam::{Account}:role/attini/attini-deployment-plan-default-states-service-role-{Region}
Required: Conditional
If the parameter CreateDeploymentPlanDefaultRole on the attini-setup CloudFormation stack is false, then this is or Policies required.
Type: String | List | Map
AWS SAM compatibility: This property is passed directly to the Policies property of an AWS::Serverless::StateMachine resource.
You provide either a RoleArn or Policies.
Required: Conditional
If the parameter CreateDeploymentPlanDefaultRole on the attini-setup CloudFormation stack is false, then this is or RoleArn required.
Type: String
AWS SAM compatibility: This property is passed directly to the PermissionsBoundary property of an AWS::Serverless::StateMachine resource.
This will only work if you create the IAM Role using the Policies configuration.
Required: No
Type: Map<String,String>
AWS SAM compatibility
: This property is passed directly to the
Tags
property of an AWS::Serverless::StateMachine resource.
Required: No
Type: String
Override Attini’s default runner.
Required: No
Type: DeploymentPlan Definition
You can define your deployment plan in different 2 ways:
Required: Yes
Transformed resources
A Attini::Deploy::DeploymentPlan
resource transforms into multiple
CloudFormation resources that together create your deployment plan.
In this example, you can see how the transformed template will look.
Original template
AWSTemplateFormatVersion: "2010-09-09"
Transform:
- AttiniDeploymentPlan
- AWS::Serverless-2016-10-31
Resources:
PublicWebsite:
Type: Attini::Deploy::DeploymentPlan
Properties:
DeploymentPlan:
...
Outputs:
DeploymentSfnPlanArn:
Description: The arn of the StepFunction generated by PublicWebsite
Value: !Ref AttiniDeploymentPlanSfnPublicWebsite
Transformed template
{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"AttiniDeploymentPlanSfnTriggerPublicWebsite": {
"Type": "Custom::AttiniDeploymentPlanTrigger",
"Properties": {
"...": "..."
}
},
"AttiniDeploymentPlanSfnPublicWebsite": {
"Type": "AWS::StepFunctions::StateMachine",
"Properties": {
"...": "..."
}
},
"AttiniPostExecutionActionsPublicWebsite": {
"Type": "AWS::Events::Rule",
"Properties": {
"...": "..."
}
}
},
"Outputs": {
"DeploymentSfnPlanArn": {
"Description": "The arn of the StepFunction generated by PublicWebsite deployment plan",
"Value": {
"Ref": "AttiniDeploymentPlanSfnPublicWebsite"
}
}
}
}