From 81526f07e4fd94c36dfed320ce11a2fe265e2ae1 Mon Sep 17 00:00:00 2001 From: Kavya Alla Date: Thu, 5 Dec 2024 09:48:20 -0800 Subject: [PATCH] Add CFN support for Declarative EC2 Policy --- aws-organizations-policy/aws-organizations-policy.json | 5 +++-- aws-organizations-policy/docs/README.md | 4 ++-- .../amazon/organizations/policy/PolicyConstants.java | 3 ++- .../amazon/organizations/policy/AbstractTestBase.java | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/aws-organizations-policy/aws-organizations-policy.json b/aws-organizations-policy/aws-organizations-policy.json index 1131cfd..964ea44 100644 --- a/aws-organizations-policy/aws-organizations-policy.json +++ b/aws-organizations-policy/aws-organizations-policy.json @@ -11,7 +11,7 @@ "maxLength": 128 }, "Type": { - "description": "The type of policy to create. You can specify one of the following values: AISERVICES_OPT_OUT_POLICY, BACKUP_POLICY, SERVICE_CONTROL_POLICY, TAG_POLICY, CHATBOT_POLICY, RESOURCE_CONTROL_POLICY", + "description": "The type of policy to create. You can specify one of the following values: AISERVICES_OPT_OUT_POLICY, BACKUP_POLICY, SERVICE_CONTROL_POLICY, TAG_POLICY, CHATBOT_POLICY, RESOURCE_CONTROL_POLICY,DECLARATIVE_POLICY_EC2", "type": "string", "enum": [ "SERVICE_CONTROL_POLICY", @@ -19,7 +19,8 @@ "BACKUP_POLICY", "TAG_POLICY", "CHATBOT_POLICY", - "RESOURCE_CONTROL_POLICY" + "RESOURCE_CONTROL_POLICY", + "DECLARATIVE_POLICY_EC2" ] }, "Content": { diff --git a/aws-organizations-policy/docs/README.md b/aws-organizations-policy/docs/README.md index 10ebade..481b9bd 100644 --- a/aws-organizations-policy/docs/README.md +++ b/aws-organizations-policy/docs/README.md @@ -57,13 +57,13 @@ _Update requires_: [No interruption](https://docs.aws.amazon.com/AWSCloudFormati #### Type -The type of policy to create. You can specify one of the following values: AISERVICES_OPT_OUT_POLICY, BACKUP_POLICY, SERVICE_CONTROL_POLICY, TAG_POLICY, CHATBOT_POLICY, RESOURCE_CONTROL_POLICY +The type of policy to create. You can specify one of the following values: AISERVICES_OPT_OUT_POLICY, BACKUP_POLICY, SERVICE_CONTROL_POLICY, TAG_POLICY, CHATBOT_POLICY, RESOURCE_CONTROL_POLICY,DECLARATIVE_POLICY_EC2 _Required_: Yes _Type_: String -_Allowed Values_: SERVICE_CONTROL_POLICY | AISERVICES_OPT_OUT_POLICY | BACKUP_POLICY | TAG_POLICY | CHATBOT_POLICY | RESOURCE_CONTROL_POLICY +_Allowed Values_: SERVICE_CONTROL_POLICY | AISERVICES_OPT_OUT_POLICY | BACKUP_POLICY | TAG_POLICY | CHATBOT_POLICY | RESOURCE_CONTROL_POLICY | DECLARATIVE_POLICY_EC2 _Update requires_: [Replacement](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html#update-replacement) diff --git a/aws-organizations-policy/src/main/java/software/amazon/organizations/policy/PolicyConstants.java b/aws-organizations-policy/src/main/java/software/amazon/organizations/policy/PolicyConstants.java index 29443c6..3403b33 100644 --- a/aws-organizations-policy/src/main/java/software/amazon/organizations/policy/PolicyConstants.java +++ b/aws-organizations-policy/src/main/java/software/amazon/organizations/policy/PolicyConstants.java @@ -8,7 +8,8 @@ public enum PolicyType { SERVICE_CONTROL_POLICY("SERVICE_CONTROL_POLICY"), TAG_POLICY("TAG_POLICY"), CHATBOT_POLICY("CHATBOT_POLICY"), - RESOURCE_CONTROL_POLICY("RESOURCE_CONTROL_POLICY"); + RESOURCE_CONTROL_POLICY("RESOURCE_CONTROL_POLICY"), + DECLARATIVE_POLICY_EC2("DECLARATIVE_POLICY_EC2"); private final String policyType; diff --git a/aws-organizations-policy/src/test/java/software/amazon/organizations/policy/AbstractTestBase.java b/aws-organizations-policy/src/test/java/software/amazon/organizations/policy/AbstractTestBase.java index c6e6475..4220877 100644 --- a/aws-organizations-policy/src/test/java/software/amazon/organizations/policy/AbstractTestBase.java +++ b/aws-organizations-policy/src/test/java/software/amazon/organizations/policy/AbstractTestBase.java @@ -49,7 +49,7 @@ public class AbstractTestBase { protected static final Set TEST_TARGET_IDS = ImmutableSet.of(TEST_TARGET_ROOT_ID, TEST_TARGET_OU_ID); protected static final Set TEST_UPDATED_TARGET_IDS = ImmutableSet.of(TEST_TARGET_ROOT_ID, TEST_TARGET_ACCOUNT_ID); protected static final String TEST_NEXT_TOKEN = "mockNextTokenItem"; - protected static final String POLICY_SCHEMA_SHA256_HEXSTRING = "82F7D81E3153063EFDB101473B21E54C9722DED9EDFA270D59390F711ACD6B24"; + protected static final String POLICY_SCHEMA_SHA256_HEXSTRING = "A182DD7473C4969EC112502EAE15828751A4C9714B158F0E3DE64065C6170842"; protected static final String POLICY_JSON_SCHEMA_FILE_NAME = "aws-organizations-policy.json"; protected static final Credentials MOCK_CREDENTIALS;