-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstackset-deploy-template.yaml
87 lines (82 loc) · 2.76 KB
/
stackset-deploy-template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
Metadata:
GhaStack:
localTemplateFile: &gha_deploy_template_body ./stacksets/gha-deploy/stackset.yaml
CfnCrStack:
localTemplateFile: &cfn_cr_template_body ./stacksets/cfn-custom-resource-deploy/stackset.yaml
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: AWS account infrastructure stackset (GHA Deployments)
Parameters:
TargetOuIds:
Type: CommaDelimitedList
Description: List of OUs
TargetRegions:
Type: CommaDelimitedList
Description: Regions to deploy to
CicdAwsAccountId:
Type: String
Description: AWS Account ID for CI/CD
DeployBucketArn:
Type: String
Description: S3 bucket ARN for deployment
CustomResourceSsmParamName:
Type: String
Description: SSM parameter name for custom resource
CustomResourceTopicName:
Type: String
Description: Custom resource ARN
Resources:
OrgCiCdGhaDeploy:
Type: AWS::CloudFormation::StackSet
Properties:
StackSetName: CiCdGhaDeploy
Description: GHA CI/CD Deployment
Parameters:
- ParameterKey: CicdAwsAccountId
ParameterValue: !Ref CicdAwsAccountId
- ParameterKey: DeployBucketArn
ParameterValue: !Ref DeployBucketArn
Capabilities:
- CAPABILITY_NAMED_IAM
StackInstancesGroup:
- DeploymentTargets:
OrganizationalUnitIds: !Ref TargetOuIds
Regions: !Ref TargetRegions
AutoDeployment:
Enabled: true
RetainStacksOnAccountRemoval: false
ManagedExecution:
Active: true
OperationPreferences:
RegionConcurrencyType: PARALLEL
FailureToleranceCount: 1
MaxConcurrentCount: 5
PermissionModel: SERVICE_MANAGED
TemplateBody: *gha_deploy_template_body
DeployAccountCfnCustomResourcesSupport:
Type: AWS::CloudFormation::StackSet
Properties:
StackSetName: OrgDeployAccountCfnCustomResourcesSupport
Description: Provides service discovery for AWS CFN Custom Resources
Parameters:
- ParameterKey: CustomResourceSsmParamName
ParameterValue: !Ref CustomResourceSsmParamName
- ParameterKey: CustomResourceTopicName
ParameterValue: !Ref CustomResourceTopicName
- ParameterKey: CicdAwsAccountId
ParameterValue: !Ref CicdAwsAccountId
StackInstancesGroup:
- DeploymentTargets:
OrganizationalUnitIds: !Ref TargetOuIds
Regions: !Ref TargetRegions
AutoDeployment:
Enabled: true
RetainStacksOnAccountRemoval: false
ManagedExecution:
Active: true
OperationPreferences:
RegionConcurrencyType: PARALLEL
FailureToleranceCount: 1
MaxConcurrentCount: 5
PermissionModel: SERVICE_MANAGED
TemplateBody: *cfn_cr_template_body