Skip to content

Commit

Permalink
Update to use progress chaining pattern for stackset
Browse files Browse the repository at this point in the history
  • Loading branch information
xiwhuang committed Apr 22, 2020
1 parent 574d4ee commit 705bb41
Show file tree
Hide file tree
Showing 43 changed files with 1,229 additions and 2,178 deletions.
3 changes: 2 additions & 1 deletion aws-cloudformation-stackset/.rpdk-config
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"amazon",
"cloudformation",
"stackset"
]
],
"codegen_template_path": "guided_aws"
}
}
13 changes: 4 additions & 9 deletions aws-cloudformation-stackset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,10 @@
Congratulations on starting development! Next steps:

1. Write the JSON schema describing your resource, `aws-cloudformation-stackset.json`
2. The RPDK will automatically generate the correct resource model from the
schema whenever the project is built via Maven. You can also do this manually
with the following command: `cfn generate`
3. Implement your resource handlers
1. Implement your resource handlers.

The RPDK will automatically generate the correct resource model from the schema whenever the project is built via Maven. You can also do this manually with the following command: `cfn generate`.

Please don't modify files under `target/generated-sources/rpdk`, as they will be
automatically overwritten.
> Please don't modify files under `target/generated-sources/rpdk`, as they will be automatically overwritten.
The code use [Lombok](https://projectlombok.org/), and [you may have to install
IDE integrations](https://projectlombok.org/) to enable auto-complete for
Lombok-annotated classes.
The code uses [Lombok](https://projectlombok.org/), and [you may have to install IDE integrations](https://projectlombok.org/) to enable auto-complete for Lombok-annotated classes.
97 changes: 62 additions & 35 deletions aws-cloudformation-stackset/aws-cloudformation-stackset.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,58 @@
}
},
"additionalProperties": false
},
"StackInstances": {
"description": "Stack instances in some specific accounts and Regions.",
"type": "object",
"properties": {
"DeploymentTargets": {
"description": " The AWS OrganizationalUnitIds or Accounts for which to create stack instances in the specified Regions.",
"type": "object",
"properties": {
"Accounts": {
"description": "AWS accounts that you want to create stack instances in the specified Region(s) for.",
"type": "array",
"uniqueItems": true,
"insertionOrder": false,
"items": {
"$ref": "#/definitions/Account"
}
},
"OrganizationalUnitIds": {
"description": "The organization root ID or organizational unit (OU) IDs to which StackSets deploys.",
"type": "array",
"uniqueItems": true,
"insertionOrder": false,
"items": {
"$ref": "#/definitions/OrganizationalUnitId"
}
}
}
},
"Regions": {
"description": "The names of one or more Regions where you want to create stack instances using the specified AWS account(s).",
"type": "array",
"uniqueItems": true,
"insertionOrder": false,
"items": {
"$ref": "#/definitions/Region"
}
},
"ParameterOverrides": {
"description": "A list of stack set parameters whose values you want to override in the selected stack instances.",
"type": "array",
"uniqueItems": true,
"insertionOrder": false,
"items": {
"$ref": "#/definitions/Parameter"
}
}
},
"required": [
"DeploymentTargets",
"Regions"
]
}
},
"properties": {
Expand All @@ -100,30 +152,6 @@
"$ref": "#/definitions/Capability"
}
},
"DeploymentTargets": {
"description": "",
"type": "object",
"properties": {
"Accounts" : {
"description": "AWS accounts that you want to create stack instances in the specified Region(s) for.",
"type": "array",
"uniqueItems": true,
"insertionOrder": false,
"items": {
"$ref": "#/definitions/Account"
}
},
"OrganizationalUnitIds": {
"description": "The organization root ID or organizational unit (OU) IDs to which StackSets deploys.",
"type": "array",
"uniqueItems": true,
"insertionOrder": false,
"items": {
"$ref": "#/definitions/OrganizationalUnitId"
}
}
}
},
"Description": {
"description": "A description of the stack set. You can use the description to identify the stack set's purpose or other important information.",
"type": "string",
Expand Down Expand Up @@ -166,6 +194,15 @@
}
}
},
"StackInstancesGroup": {
"description": "",
"type": "array",
"uniqueItems": true,
"insertionOrder": false,
"items": {
"$ref": "#/definitions/StackInstances"
}
},
"Parameters": {
"description": "The input parameters for the stack set template.",
"type": "array",
Expand All @@ -183,15 +220,6 @@
"SELF_MANAGED"
]
},
"Regions": {
"description": "The names of one or more Regions where you want to create stack instances using the specified AWS account(s).",
"type": "array",
"uniqueItems": true,
"insertionOrder": false,
"items": {
"$ref": "#/definitions/Region"
}
},
"Tags": {
"description": "The key-value pairs to associate with this stack set and the stacks created from it. AWS CloudFormation also propagates these tags to supported resources that are created in the stacks. A maximum number of 50 tags can be specified.",
"type": "array",
Expand All @@ -216,8 +244,7 @@
}
},
"required": [
"PermissionModel",
"Regions"
"PermissionModel"
],
"additionalProperties": false,
"createOnlyProperties": [
Expand Down
17 changes: 5 additions & 12 deletions aws-cloudformation-stackset/pom.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>software.amazon.cloudformation.stackset</groupId>
Expand Down Expand Up @@ -30,7 +30,7 @@
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>bom</artifactId>
<version>2.11.12</version>
<version>2.10.70</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -191,6 +191,7 @@
<excludes>
<exclude>**/Configuration*</exclude>
<exclude>**/util/AwsCredentialsExtractor*</exclude>
<exclude>**/util/ClientBuilder*</exclude>
<exclude>**/BaseConfiguration*</exclude>
<exclude>**/BaseHandler*</exclude>
<exclude>**/HandlerWrapper*</exclude>
Expand Down Expand Up @@ -246,13 +247,5 @@
</includes>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/</directory>
<includes>
<include>**/resources/*</include>
</includes>
</testResource>
</testResources>
</build>
</project>
Loading

0 comments on commit 705bb41

Please sign in to comment.