From aa1483a21a53dc344249fefd90734e2e49c218f2 Mon Sep 17 00:00:00 2001 From: aristosvo <8375124+aristosvo@users.noreply.github.com> Date: Thu, 12 Dec 2024 13:44:24 +0100 Subject: [PATCH] [Docs] Add Declarative Policy for EC2 and Chatbot Policy documentation --- .../organizations/organization_test.go | 24 +++++++++++++++++++ .../d/organizations_policies.html.markdown | 2 +- ...izations_policies_for_target.html.markdown | 2 +- .../docs/d/organizations_policy.html.markdown | 2 +- .../organizations_organization.html.markdown | 2 +- .../docs/r/organizations_policy.html.markdown | 6 ++++- 6 files changed, 33 insertions(+), 5 deletions(-) diff --git a/internal/service/organizations/organization_test.go b/internal/service/organizations/organization_test.go index c2e825bee97..02358a8620e 100644 --- a/internal/service/organizations/organization_test.go +++ b/internal/service/organizations/organization_test.go @@ -186,6 +186,30 @@ func testAccOrganization_EnabledPolicyTypes(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.0", string(awstypes.PolicyTypeBackupPolicy)), ), }, + { + Config: testAccOrganizationConfig_enabledPolicyTypes1(string(awstypes.PolicyTypeChatbotPolicy)), + Check: resource.ComposeTestCheckFunc( + testAccCheckOrganizationExists(ctx, resourceName, &organization), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.0", string(awstypes.PolicyTypeChatbotPolicy)), + ), + }, + { + Config: testAccOrganizationConfig_enabledPolicyTypes1(string(awstypes.PolicyTypeDeclarativePolicyEc2)), + Check: resource.ComposeTestCheckFunc( + testAccCheckOrganizationExists(ctx, resourceName, &organization), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.0", string(awstypes.PolicyTypeDeclarativePolicyEc2)), + ), + }, + { + Config: testAccOrganizationConfig_enabledPolicyTypes1(string(awstypes.PolicyTypeResourceControlPolicy)), + Check: resource.ComposeTestCheckFunc( + testAccCheckOrganizationExists(ctx, resourceName, &organization), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.0", string(awstypes.PolicyTypeResourceControlPolicy)), + ), + }, { Config: testAccOrganizationConfig_enabledPolicyTypes1(string(awstypes.PolicyTypeTagPolicy)), Check: resource.ComposeTestCheckFunc( diff --git a/website/docs/d/organizations_policies.html.markdown b/website/docs/d/organizations_policies.html.markdown index 38ef475aa84..2816121b97c 100644 --- a/website/docs/d/organizations_policies.html.markdown +++ b/website/docs/d/organizations_policies.html.markdown @@ -29,7 +29,7 @@ data "aws_organizations_policy" "example" { The following arguments are required: -* `filter` - (Required) The type of policies to be returned in the response. Valid values are `AISERVICES_OPT_OUT_POLICY | BACKUP_POLICY | RESOURCE_CONTROL_POLICY | SERVICE_CONTROL_POLICY | TAG_POLICY` +* `filter` - (Required) The type of policies to be returned in the response. Valid values are `AISERVICES_OPT_OUT_POLICY | BACKUP_POLICY | CHATBOT_POLICY | DECLARATIVE_POLICY_EC2 | RESOURCE_CONTROL_POLICY | SERVICE_CONTROL_POLICY | TAG_POLICY` ## Attribute Reference diff --git a/website/docs/d/organizations_policies_for_target.html.markdown b/website/docs/d/organizations_policies_for_target.html.markdown index 4effa3e36f4..7e3c0a3b8bb 100644 --- a/website/docs/d/organizations_policies_for_target.html.markdown +++ b/website/docs/d/organizations_policies_for_target.html.markdown @@ -33,7 +33,7 @@ data "aws_organizations_policy" "example" { The following arguments are required: * `target_id` - (Required) The root (string that begins with "r-" followed by 4-32 lowercase letters or digits), account (12 digit string), or Organizational Unit (string starting with "ou-" followed by 4-32 lowercase letters or digits. This string is followed by a second "-" dash and from 8-32 additional lowercase letters or digits.) -* `filter` - (Required) Must supply one of the 5 different policy filters for a target (AISERVICES_OPT_OUT_POLICY | BACKUP_POLICY | RESOURCE_CONTROL_POLICY | SERVICE_CONTROL_POLICY | TAG_POLICY) +* `filter` - (Required) Must supply one of the 7 different policy filters for a target (AISERVICES_OPT_OUT_POLICY | BACKUP_POLICY | CHATBOT_POLICY | DECLARATIVE_POLICY_EC2 | RESOURCE_CONTROL_POLICY | SERVICE_CONTROL_POLICY | TAG_POLICY) ## Attribute Reference diff --git a/website/docs/d/organizations_policy.html.markdown b/website/docs/d/organizations_policy.html.markdown index 19f67e24f8e..13a96161945 100644 --- a/website/docs/d/organizations_policy.html.markdown +++ b/website/docs/d/organizations_policy.html.markdown @@ -41,4 +41,4 @@ This data source exports the following attributes in addition to the arguments a * `content` - The text content of the policy. * `description` - The description of the policy. * `name` - The friendly name of the policy. -* `type` - The type of policy values can be `AISERVICES_OPT_OUT_POLICY | BACKUP_POLICY | RESOURCE_CONTROL_POLICY | SERVICE_CONTROL_POLICY | TAG_POLICY` +* `type` - The type of policy values can be `AISERVICES_OPT_OUT_POLICY | BACKUP_POLICY | CHATBOT_POLICY | DECLARATIVE_POLICY_EC2 | RESOURCE_CONTROL_POLICY | SERVICE_CONTROL_POLICY | TAG_POLICY` diff --git a/website/docs/r/organizations_organization.html.markdown b/website/docs/r/organizations_organization.html.markdown index 05082f502f8..d4fe3485fde 100644 --- a/website/docs/r/organizations_organization.html.markdown +++ b/website/docs/r/organizations_organization.html.markdown @@ -32,7 +32,7 @@ resource "aws_organizations_organization" "org" { This resource supports the following arguments: * `aws_service_access_principals` - (Optional) List of AWS service principal names for which you want to enable integration with your organization. This is typically in the form of a URL, such as service-abbreviation.amazonaws.com. Organization must have `feature_set` set to `ALL`. Some services do not support enablement via this endpoint, see [warning in aws docs](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html). -* `enabled_policy_types` - (Optional) List of Organizations policy types to enable in the Organization Root. Organization must have `feature_set` set to `ALL`. For additional information about valid policy types (e.g., `AISERVICES_OPT_OUT_POLICY`, `BACKUP_POLICY`, `RESOURCE_CONTROL_POLICY`, `SERVICE_CONTROL_POLICY`, and `TAG_POLICY`), see the [AWS Organizations API Reference](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnablePolicyType.html). +* `enabled_policy_types` - (Optional) List of Organizations policy types to enable in the Organization Root. Organization must have `feature_set` set to `ALL`. For additional information about valid policy types (e.g., `AISERVICES_OPT_OUT_POLICY`, `BACKUP_POLICY`, `CHATBOT_POLICY`, `DECLARATIVE_POLICY_EC2`, `RESOURCE_CONTROL_POLICY`, `SERVICE_CONTROL_POLICY`, and `TAG_POLICY`), see the [AWS Organizations API Reference](https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnablePolicyType.html). * `feature_set` - (Optional) Specify "ALL" (default) or "CONSOLIDATED_BILLING". ## Attribute Reference diff --git a/website/docs/r/organizations_policy.html.markdown b/website/docs/r/organizations_policy.html.markdown index 108cf301294..09ae5cd5df0 100644 --- a/website/docs/r/organizations_policy.html.markdown +++ b/website/docs/r/organizations_policy.html.markdown @@ -33,13 +33,17 @@ This resource supports the following arguments: * `content` - (Required) The policy content to add to the new policy. For example, if you create a [service control policy (SCP)](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html), this string must be JSON text that specifies the permissions that admins in attached accounts can delegate to their users, groups, and roles. + +For more information about the AI Services opt-out Policy syntax, see the [AI Services opt-out Policy Syntax documentation](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out_syntax.html). +For more information about the Chatbot Policy syntax, see the [Chatbot Policy Syntax documentation](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_chatbot_syntax.html). +For more information about the Declarative Policy syntax, see the [Declarative Policy Syntax documentation](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative_syntax.html). For more information about the RCP syntax, see the [Resource Control Policy Syntax documentation](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_rcps_syntax.html). For more information about the SCP syntax, see the [Service Control Policy Syntax documentation](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html). For more information on the Tag Policy syntax, see the [Tag Policy Syntax documentation](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_example-tag-policies.html). * `name` - (Required) The friendly name to assign to the policy. * `description` - (Optional) A description to assign to the policy. * `skip_destroy` - (Optional) If set to `true`, destroy will **not** delete the policy and instead just remove the resource from state. This can be useful in situations where the policies (and the associated attachment) must be preserved to meet the AWS minimum requirement of 1 attached policy. -* `type` - (Optional) The type of policy to create. Valid values are `AISERVICES_OPT_OUT_POLICY`, `BACKUP_POLICY`, `RESOURCE_CONTROL_POLICY` (RCP), `SERVICE_CONTROL_POLICY` (SCP), and `TAG_POLICY`. Defaults to `SERVICE_CONTROL_POLICY`. +* `type` - (Optional) The type of policy to create. Valid values are `AISERVICES_OPT_OUT_POLICY`, `BACKUP_POLICY`, `CHATBOT_POLICY`, `DECLARATIVE_POLICY_EC2`,`RESOURCE_CONTROL_POLICY` (RCP), `SERVICE_CONTROL_POLICY` (SCP), and `TAG_POLICY`. Defaults to `SERVICE_CONTROL_POLICY`. * `tags` - (Optional) Key-value map of resource tags. If configured with a provider [`default_tags` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attribute Reference