Skip to content

Commit

Permalink
[Maestro-14785] Fix DeploymentTarget - AccountURL in resource handler…
Browse files Browse the repository at this point in the history
… and documentation
  • Loading branch information
danielsun776 committed Jul 17, 2023
1 parent f30e939 commit 088c466
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions aws-cloudformation-stackset/aws-cloudformation-stackset.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@
"$ref": "#/definitions/Account"
}
},
"AccountsUrl": {
"description": "Returns the value of the AccountsUrl property.",
"type": "string",
"minLength": 1,
"maxLength": 5120,
"pattern": "(s3://|http(s?)://).+"
},
"OrganizationalUnitIds": {
"description": "The organization root ID or organizational unit (OU) IDs to which StackSets deploys.",
"type": "array",
Expand Down
16 changes: 16 additions & 0 deletions aws-cloudformation-stackset/docs/deploymenttargets.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ To declare this entity in your AWS CloudFormation template, use the following sy
<pre>
{
"<a href="#accounts" title="Accounts">Accounts</a>" : <i>[ String, ... ]</i>,
"<a href="#accountsUrl" title="AccountsUrl">AccountsUrl</a>" : <i>String</i>,
"<a href="#organizationalunitids" title="OrganizationalUnitIds">OrganizationalUnitIds</a>" : <i>[ String, ... ]</i>,
"<a href="#accountfiltertype" title="AccountFilterType">AccountFilterType</a>" : <i>String</i>
}
Expand All @@ -21,6 +22,7 @@ To declare this entity in your AWS CloudFormation template, use the following sy
<pre>
<a href="#accounts" title="Accounts">Accounts</a>: <i>
- String</i>
<a href="#accountsurl" title="AccountsUrl">AccountsUrl</a>: <i>String</i>
<a href="#organizationalunitids" title="OrganizationalUnitIds">OrganizationalUnitIds</a>: <i>
- String</i>
<a href="#accountfiltertype" title="AccountFilterType">AccountFilterType</a>: <i>String</i>
Expand All @@ -38,6 +40,20 @@ _Type_: List of String

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### AccountsUrl

Returns the value of the AccountsUrl property.

_Required_: No

_Type_: String

_Length Constraints_: Minimum length of 1. Maximum length of 5120.

_Pattern_: `(s3://|http(s?)://).+`

_Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-no-interrupt)

#### OrganizationalUnitIds

The organization root ID or organizational unit (OU) IDs to which StackSets deploys.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ static DeploymentTargets translateToSdkDeploymentTargets(
final software.amazon.cloudformation.stackset.DeploymentTargets deploymentTargets) {
return DeploymentTargets.builder()
.accounts(deploymentTargets.getAccounts())
.accountsUrl(deploymentTargets.getAccountsUrl())
.organizationalUnitIds(deploymentTargets.getOrganizationalUnitIds())
.accountFilterType(deploymentTargets.getAccountFilterType())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static software.amazon.cloudformation.stackset.translator.PropertyTranslator.translateToSdkOperationPreferences;
import static software.amazon.cloudformation.stackset.translator.PropertyTranslator.translateToSdkTags;
import static software.amazon.cloudformation.stackset.translator.PropertyTranslator.translateToStackInstance;
import static software.amazon.cloudformation.stackset.util.AltTestUtils.ACCOUNTS_URL;
import static software.amazon.cloudformation.stackset.util.AltTestUtils.INTER;
import static software.amazon.cloudformation.stackset.util.AltTestUtils.OU_1;
import static software.amazon.cloudformation.stackset.util.AltTestUtils.account_1;
Expand Down Expand Up @@ -90,6 +91,7 @@ public void test_translateToSdkDeploymentTargets() {
software.amazon.cloudformation.stackset.DeploymentTargets.builder()
.organizationalUnitIds(new HashSet<>(Arrays.asList(OU_1)))
.accounts(new HashSet<>(Arrays.asList(account_1)))
.accountsUrl(ACCOUNTS_URL)
.accountFilterType(INTER)
.build();

Expand All @@ -99,6 +101,7 @@ public void test_translateToSdkDeploymentTargets() {
.isEqualTo(new HashSet<>(Arrays.asList(OU_1)));
assertThat(new HashSet<>(sdkDeploymentTargets.accounts()))
.isEqualTo(new HashSet<>(Arrays.asList(account_1)));
assertThat(sdkDeploymentTargets.accountsUrl()).isEqualTo(ACCOUNTS_URL);
assertThat(sdkDeploymentTargets.accountFilterTypeAsString()).isEqualTo(INTER);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class AltTestUtils {
public final static String region_2 = "us-west-1";
public final static String region_3 = "us-east-2";
public final static String region_4 = "us-east-1";
public final static String ACCOUNTS_URL = "http://test";

public final static Set<String> singleton_region_set = new HashSet<>(Collections.singletonList(region_1));

Expand Down

0 comments on commit 088c466

Please sign in to comment.