1. Packages
  2. AWS Cloud Control
  3. API Docs
  4. logs
  5. getAccountPolicy

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.logs.getAccountPolicy

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

The AWS::Logs::AccountPolicy resource specifies a CloudWatch Logs AccountPolicy.

Using getAccountPolicy

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 getAccountPolicy(args: GetAccountPolicyArgs, opts?: InvokeOptions): Promise<GetAccountPolicyResult>
function getAccountPolicyOutput(args: GetAccountPolicyOutputArgs, opts?: InvokeOptions): Output<GetAccountPolicyResult>
Copy
def get_account_policy(account_id: Optional[str] = None,
                       policy_name: Optional[str] = None,
                       policy_type: Optional[AccountPolicyPolicyType] = None,
                       opts: Optional[InvokeOptions] = None) -> GetAccountPolicyResult
def get_account_policy_output(account_id: Optional[pulumi.Input[str]] = None,
                       policy_name: Optional[pulumi.Input[str]] = None,
                       policy_type: Optional[pulumi.Input[AccountPolicyPolicyType]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetAccountPolicyResult]
Copy
func LookupAccountPolicy(ctx *Context, args *LookupAccountPolicyArgs, opts ...InvokeOption) (*LookupAccountPolicyResult, error)
func LookupAccountPolicyOutput(ctx *Context, args *LookupAccountPolicyOutputArgs, opts ...InvokeOption) LookupAccountPolicyResultOutput
Copy

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

public static class GetAccountPolicy 
{
    public static Task<GetAccountPolicyResult> InvokeAsync(GetAccountPolicyArgs args, InvokeOptions? opts = null)
    public static Output<GetAccountPolicyResult> Invoke(GetAccountPolicyInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAccountPolicyResult> getAccountPolicy(GetAccountPolicyArgs args, InvokeOptions options)
public static Output<GetAccountPolicyResult> getAccountPolicy(GetAccountPolicyArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: aws-native:logs:getAccountPolicy
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AccountId This property is required. string
User account id
PolicyName This property is required. string
The name of the account policy
PolicyType This property is required. Pulumi.AwsNative.Logs.AccountPolicyPolicyType
Type of the policy.
AccountId This property is required. string
User account id
PolicyName This property is required. string
The name of the account policy
PolicyType This property is required. AccountPolicyPolicyType
Type of the policy.
accountId This property is required. String
User account id
policyName This property is required. String
The name of the account policy
policyType This property is required. AccountPolicyPolicyType
Type of the policy.
accountId This property is required. string
User account id
policyName This property is required. string
The name of the account policy
policyType This property is required. AccountPolicyPolicyType
Type of the policy.
account_id This property is required. str
User account id
policy_name This property is required. str
The name of the account policy
policy_type This property is required. AccountPolicyPolicyType
Type of the policy.
accountId This property is required. String
User account id
policyName This property is required. String
The name of the account policy
policyType This property is required. "DATA_PROTECTION_POLICY" | "SUBSCRIPTION_FILTER_POLICY" | "FIELD_INDEX_POLICY" | "TRANSFORMER_POLICY"
Type of the policy.

getAccountPolicy Result

The following output properties are available:

AccountId string
User account id
PolicyDocument string

The body of the policy document you want to use for this topic.

You can only add one policy per PolicyType.

The policy must be in JSON string format.

Length Constraints: Maximum length of 30720

Scope Pulumi.AwsNative.Logs.AccountPolicyScope
Scope for policy application
SelectionCriteria string
Log group selection criteria to apply policy only to a subset of log groups. SelectionCriteria string can be up to 25KB and cloudwatchlogs determines the length of selectionCriteria by using its UTF-8 bytes
AccountId string
User account id
PolicyDocument string

The body of the policy document you want to use for this topic.

You can only add one policy per PolicyType.

The policy must be in JSON string format.

Length Constraints: Maximum length of 30720

Scope AccountPolicyScope
Scope for policy application
SelectionCriteria string
Log group selection criteria to apply policy only to a subset of log groups. SelectionCriteria string can be up to 25KB and cloudwatchlogs determines the length of selectionCriteria by using its UTF-8 bytes
accountId String
User account id
policyDocument String

The body of the policy document you want to use for this topic.

You can only add one policy per PolicyType.

The policy must be in JSON string format.

Length Constraints: Maximum length of 30720

scope AccountPolicyScope
Scope for policy application
selectionCriteria String
Log group selection criteria to apply policy only to a subset of log groups. SelectionCriteria string can be up to 25KB and cloudwatchlogs determines the length of selectionCriteria by using its UTF-8 bytes
accountId string
User account id
policyDocument string

The body of the policy document you want to use for this topic.

You can only add one policy per PolicyType.

The policy must be in JSON string format.

Length Constraints: Maximum length of 30720

scope AccountPolicyScope
Scope for policy application
selectionCriteria string
Log group selection criteria to apply policy only to a subset of log groups. SelectionCriteria string can be up to 25KB and cloudwatchlogs determines the length of selectionCriteria by using its UTF-8 bytes
account_id str
User account id
policy_document str

The body of the policy document you want to use for this topic.

You can only add one policy per PolicyType.

The policy must be in JSON string format.

Length Constraints: Maximum length of 30720

scope AccountPolicyScope
Scope for policy application
selection_criteria str
Log group selection criteria to apply policy only to a subset of log groups. SelectionCriteria string can be up to 25KB and cloudwatchlogs determines the length of selectionCriteria by using its UTF-8 bytes
accountId String
User account id
policyDocument String

The body of the policy document you want to use for this topic.

You can only add one policy per PolicyType.

The policy must be in JSON string format.

Length Constraints: Maximum length of 30720

scope "ALL"
Scope for policy application
selectionCriteria String
Log group selection criteria to apply policy only to a subset of log groups. SelectionCriteria string can be up to 25KB and cloudwatchlogs determines the length of selectionCriteria by using its UTF-8 bytes

Supporting Types

AccountPolicyPolicyType

AccountPolicyScope

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