1. Packages
  2. AWS Cloud Control
  3. API Docs
  4. organizations
  5. getPolicy

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.27.0 published on Monday, Apr 14, 2025 by Pulumi

aws-native.organizations.getPolicy

Explore with Pulumi AI

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.27.0 published on Monday, Apr 14, 2025 by Pulumi

Policies in AWS Organizations enable you to manage different features of the AWS accounts in your organization. You can use policies when all features are enabled in your organization.

Using getPolicy

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getPolicy(args: GetPolicyArgs, opts?: InvokeOptions): Promise<GetPolicyResult>
function getPolicyOutput(args: GetPolicyOutputArgs, opts?: InvokeOptions): Output<GetPolicyResult>
Copy
def get_policy(id: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetPolicyResult
def get_policy_output(id: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetPolicyResult]
Copy
func LookupPolicy(ctx *Context, args *LookupPolicyArgs, opts ...InvokeOption) (*LookupPolicyResult, error)
func LookupPolicyOutput(ctx *Context, args *LookupPolicyOutputArgs, opts ...InvokeOption) LookupPolicyResultOutput
Copy

> Note: This function is named LookupPolicy in the Go SDK.

public static class GetPolicy 
{
    public static Task<GetPolicyResult> InvokeAsync(GetPolicyArgs args, InvokeOptions? opts = null)
    public static Output<GetPolicyResult> Invoke(GetPolicyInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetPolicyResult> getPolicy(GetPolicyArgs args, InvokeOptions options)
public static Output<GetPolicyResult> getPolicy(GetPolicyArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws-native:organizations:getPolicy
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Id This property is required. string
Id of the Policy
Id This property is required. string
Id of the Policy
id This property is required. String
Id of the Policy
id This property is required. string
Id of the Policy
id This property is required. str
Id of the Policy
id This property is required. String
Id of the Policy

getPolicy Result

The following output properties are available:

Arn string
ARN of the Policy
AwsManaged bool
A boolean value that indicates whether the specified policy is an AWS managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.
Content object

The Policy text content. For AWS CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. AWS CloudFormation always converts a YAML policy to JSON format before submitting it.

Search the CloudFormation User Guide for AWS::Organizations::Policy for more information about the expected schema for this property.

Description string
Human readable description of the policy
Id string
Id of the Policy
Name string
Name of the Policy
Tags List<Pulumi.AwsNative.Outputs.Tag>
A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
TargetIds List<string>
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to
Arn string
ARN of the Policy
AwsManaged bool
A boolean value that indicates whether the specified policy is an AWS managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.
Content interface{}

The Policy text content. For AWS CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. AWS CloudFormation always converts a YAML policy to JSON format before submitting it.

Search the CloudFormation User Guide for AWS::Organizations::Policy for more information about the expected schema for this property.

Description string
Human readable description of the policy
Id string
Id of the Policy
Name string
Name of the Policy
Tags Tag
A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
TargetIds []string
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to
arn String
ARN of the Policy
awsManaged Boolean
A boolean value that indicates whether the specified policy is an AWS managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.
content Object

The Policy text content. For AWS CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. AWS CloudFormation always converts a YAML policy to JSON format before submitting it.

Search the CloudFormation User Guide for AWS::Organizations::Policy for more information about the expected schema for this property.

description String
Human readable description of the policy
id String
Id of the Policy
name String
Name of the Policy
tags List<Tag>
A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
targetIds List<String>
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to
arn string
ARN of the Policy
awsManaged boolean
A boolean value that indicates whether the specified policy is an AWS managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.
content any

The Policy text content. For AWS CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. AWS CloudFormation always converts a YAML policy to JSON format before submitting it.

Search the CloudFormation User Guide for AWS::Organizations::Policy for more information about the expected schema for this property.

description string
Human readable description of the policy
id string
Id of the Policy
name string
Name of the Policy
tags Tag[]
A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
targetIds string[]
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to
arn str
ARN of the Policy
aws_managed bool
A boolean value that indicates whether the specified policy is an AWS managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.
content Any

The Policy text content. For AWS CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. AWS CloudFormation always converts a YAML policy to JSON format before submitting it.

Search the CloudFormation User Guide for AWS::Organizations::Policy for more information about the expected schema for this property.

description str
Human readable description of the policy
id str
Id of the Policy
name str
Name of the Policy
tags Sequence[root_Tag]
A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
target_ids Sequence[str]
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to
arn String
ARN of the Policy
awsManaged Boolean
A boolean value that indicates whether the specified policy is an AWS managed policy. If true, then you can attach the policy to roots, OUs, or accounts, but you cannot edit it.
content Any

The Policy text content. For AWS CloudFormation templates formatted in YAML, you can provide the policy in JSON or YAML format. AWS CloudFormation always converts a YAML policy to JSON format before submitting it.

Search the CloudFormation User Guide for AWS::Organizations::Policy for more information about the expected schema for this property.

description String
Human readable description of the policy
id String
Id of the Policy
name String
Name of the Policy
tags List<Property Map>
A list of tags that you want to attach to the newly created policy. For each tag in the list, you must specify both a tag key and a value. You can set the value to an empty string, but you can't set it to null.
targetIds List<String>
List of unique identifiers (IDs) of the root, OU, or account that you want to attach the policy to

Supporting Types

Tag

Key This property is required. string
The key name of the tag
Value This property is required. string
The value of the tag
Key This property is required. string
The key name of the tag
Value This property is required. string
The value of the tag
key This property is required. String
The key name of the tag
value This property is required. String
The value of the tag
key This property is required. string
The key name of the tag
value This property is required. string
The value of the tag
key This property is required. str
The key name of the tag
value This property is required. str
The value of the tag
key This property is required. String
The key name of the tag
value This property is required. String
The value of the tag

Package Details

Repository
AWS Native pulumi/pulumi-aws-native
License
Apache-2.0

We recommend new projects start with resources from the AWS provider.

AWS Cloud Control v1.27.0 published on Monday, Apr 14, 2025 by Pulumi