1. Packages
  2. AWS
  3. API Docs
  4. cloudwatch
  5. LogAccountPolicy
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.cloudwatch.LogAccountPolicy

Explore with Pulumi AI

Provides a CloudWatch Log Account Policy resource.

Example Usage

Account Data Protection Policy

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const dataProtection = new aws.cloudwatch.LogAccountPolicy("data_protection", {
    policyName: "data-protection",
    policyType: "DATA_PROTECTION_POLICY",
    policyDocument: JSON.stringify({
        Name: "DataProtection",
        Version: "2021-06-01",
        Statement: [
            {
                Sid: "Audit",
                DataIdentifier: ["arn:aws:dataprotection::aws:data-identifier/EmailAddress"],
                Operation: {
                    Audit: {
                        FindingsDestination: {},
                    },
                },
            },
            {
                Sid: "Redact",
                DataIdentifier: ["arn:aws:dataprotection::aws:data-identifier/EmailAddress"],
                Operation: {
                    Deidentify: {
                        MaskConfig: {},
                    },
                },
            },
        ],
    }),
});
Copy
import pulumi
import json
import pulumi_aws as aws

data_protection = aws.cloudwatch.LogAccountPolicy("data_protection",
    policy_name="data-protection",
    policy_type="DATA_PROTECTION_POLICY",
    policy_document=json.dumps({
        "Name": "DataProtection",
        "Version": "2021-06-01",
        "Statement": [
            {
                "Sid": "Audit",
                "DataIdentifier": ["arn:aws:dataprotection::aws:data-identifier/EmailAddress"],
                "Operation": {
                    "Audit": {
                        "FindingsDestination": {},
                    },
                },
            },
            {
                "Sid": "Redact",
                "DataIdentifier": ["arn:aws:dataprotection::aws:data-identifier/EmailAddress"],
                "Operation": {
                    "Deidentify": {
                        "MaskConfig": {},
                    },
                },
            },
        ],
    }))
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"Name":    "DataProtection",
			"Version": "2021-06-01",
			"Statement": []interface{}{
				map[string]interface{}{
					"Sid": "Audit",
					"DataIdentifier": []string{
						"arn:aws:dataprotection::aws:data-identifier/EmailAddress",
					},
					"Operation": map[string]interface{}{
						"Audit": map[string]interface{}{
							"FindingsDestination": map[string]interface{}{},
						},
					},
				},
				map[string]interface{}{
					"Sid": "Redact",
					"DataIdentifier": []string{
						"arn:aws:dataprotection::aws:data-identifier/EmailAddress",
					},
					"Operation": map[string]interface{}{
						"Deidentify": map[string]interface{}{
							"MaskConfig": map[string]interface{}{},
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = cloudwatch.NewLogAccountPolicy(ctx, "data_protection", &cloudwatch.LogAccountPolicyArgs{
			PolicyName:     pulumi.String("data-protection"),
			PolicyType:     pulumi.String("DATA_PROTECTION_POLICY"),
			PolicyDocument: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var dataProtection = new Aws.CloudWatch.LogAccountPolicy("data_protection", new()
    {
        PolicyName = "data-protection",
        PolicyType = "DATA_PROTECTION_POLICY",
        PolicyDocument = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["Name"] = "DataProtection",
            ["Version"] = "2021-06-01",
            ["Statement"] = new[]
            {
                new Dictionary<string, object?>
                {
                    ["Sid"] = "Audit",
                    ["DataIdentifier"] = new[]
                    {
                        "arn:aws:dataprotection::aws:data-identifier/EmailAddress",
                    },
                    ["Operation"] = new Dictionary<string, object?>
                    {
                        ["Audit"] = new Dictionary<string, object?>
                        {
                            ["FindingsDestination"] = new Dictionary<string, object?>
                            {
                            },
                        },
                    },
                },
                new Dictionary<string, object?>
                {
                    ["Sid"] = "Redact",
                    ["DataIdentifier"] = new[]
                    {
                        "arn:aws:dataprotection::aws:data-identifier/EmailAddress",
                    },
                    ["Operation"] = new Dictionary<string, object?>
                    {
                        ["Deidentify"] = new Dictionary<string, object?>
                        {
                            ["MaskConfig"] = new Dictionary<string, object?>
                            {
                            },
                        },
                    },
                },
            },
        }),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.LogAccountPolicy;
import com.pulumi.aws.cloudwatch.LogAccountPolicyArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var dataProtection = new LogAccountPolicy("dataProtection", LogAccountPolicyArgs.builder()
            .policyName("data-protection")
            .policyType("DATA_PROTECTION_POLICY")
            .policyDocument(serializeJson(
                jsonObject(
                    jsonProperty("Name", "DataProtection"),
                    jsonProperty("Version", "2021-06-01"),
                    jsonProperty("Statement", jsonArray(
                        jsonObject(
                            jsonProperty("Sid", "Audit"),
                            jsonProperty("DataIdentifier", jsonArray("arn:aws:dataprotection::aws:data-identifier/EmailAddress")),
                            jsonProperty("Operation", jsonObject(
                                jsonProperty("Audit", jsonObject(
                                    jsonProperty("FindingsDestination", jsonObject(

                                    ))
                                ))
                            ))
                        ), 
                        jsonObject(
                            jsonProperty("Sid", "Redact"),
                            jsonProperty("DataIdentifier", jsonArray("arn:aws:dataprotection::aws:data-identifier/EmailAddress")),
                            jsonProperty("Operation", jsonObject(
                                jsonProperty("Deidentify", jsonObject(
                                    jsonProperty("MaskConfig", jsonObject(

                                    ))
                                ))
                            ))
                        )
                    ))
                )))
            .build());

    }
}
Copy
resources:
  dataProtection:
    type: aws:cloudwatch:LogAccountPolicy
    name: data_protection
    properties:
      policyName: data-protection
      policyType: DATA_PROTECTION_POLICY
      policyDocument:
        fn::toJSON:
          Name: DataProtection
          Version: 2021-06-01
          Statement:
            - Sid: Audit
              DataIdentifier:
                - arn:aws:dataprotection::aws:data-identifier/EmailAddress
              Operation:
                Audit:
                  FindingsDestination: {}
            - Sid: Redact
              DataIdentifier:
                - arn:aws:dataprotection::aws:data-identifier/EmailAddress
              Operation:
                Deidentify:
                  MaskConfig: {}
Copy

Subscription Filter Policy

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const subscriptionFilter = new aws.cloudwatch.LogAccountPolicy("subscription_filter", {
    policyName: "subscription-filter",
    policyType: "SUBSCRIPTION_FILTER_POLICY",
    policyDocument: JSON.stringify({
        DestinationArn: test.arn,
        FilterPattern: "test",
    }),
    selectionCriteria: "LogGroupName NOT IN [\"excluded_log_group_name\"]",
});
Copy
import pulumi
import json
import pulumi_aws as aws

subscription_filter = aws.cloudwatch.LogAccountPolicy("subscription_filter",
    policy_name="subscription-filter",
    policy_type="SUBSCRIPTION_FILTER_POLICY",
    policy_document=json.dumps({
        "DestinationArn": test["arn"],
        "FilterPattern": "test",
    }),
    selection_criteria="LogGroupName NOT IN [\"excluded_log_group_name\"]")
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"DestinationArn": test.Arn,
			"FilterPattern":  "test",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = cloudwatch.NewLogAccountPolicy(ctx, "subscription_filter", &cloudwatch.LogAccountPolicyArgs{
			PolicyName:        pulumi.String("subscription-filter"),
			PolicyType:        pulumi.String("SUBSCRIPTION_FILTER_POLICY"),
			PolicyDocument:    pulumi.String(json0),
			SelectionCriteria: pulumi.String("LogGroupName NOT IN [\"excluded_log_group_name\"]"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var subscriptionFilter = new Aws.CloudWatch.LogAccountPolicy("subscription_filter", new()
    {
        PolicyName = "subscription-filter",
        PolicyType = "SUBSCRIPTION_FILTER_POLICY",
        PolicyDocument = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["DestinationArn"] = test.Arn,
            ["FilterPattern"] = "test",
        }),
        SelectionCriteria = "LogGroupName NOT IN [\"excluded_log_group_name\"]",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.LogAccountPolicy;
import com.pulumi.aws.cloudwatch.LogAccountPolicyArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var subscriptionFilter = new LogAccountPolicy("subscriptionFilter", LogAccountPolicyArgs.builder()
            .policyName("subscription-filter")
            .policyType("SUBSCRIPTION_FILTER_POLICY")
            .policyDocument(serializeJson(
                jsonObject(
                    jsonProperty("DestinationArn", test.arn()),
                    jsonProperty("FilterPattern", "test")
                )))
            .selectionCriteria("LogGroupName NOT IN [\"excluded_log_group_name\"]")
            .build());

    }
}
Copy
resources:
  subscriptionFilter:
    type: aws:cloudwatch:LogAccountPolicy
    name: subscription_filter
    properties:
      policyName: subscription-filter
      policyType: SUBSCRIPTION_FILTER_POLICY
      policyDocument:
        fn::toJSON:
          DestinationArn: ${test.arn}
          FilterPattern: test
      selectionCriteria: LogGroupName NOT IN ["excluded_log_group_name"]
Copy

Field Index Policy

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const fieldIndex = new aws.cloudwatch.LogAccountPolicy("field_index", {
    policyName: "field-index",
    policyType: "FIELD_INDEX_POLICY",
    policyDocument: JSON.stringify({
        Fields: [
            "field1",
            "field2",
        ],
    }),
});
Copy
import pulumi
import json
import pulumi_aws as aws

field_index = aws.cloudwatch.LogAccountPolicy("field_index",
    policy_name="field-index",
    policy_type="FIELD_INDEX_POLICY",
    policy_document=json.dumps({
        "Fields": [
            "field1",
            "field2",
        ],
    }))
Copy
package main

import (
	"encoding/json"

	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/cloudwatch"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"Fields": []string{
				"field1",
				"field2",
			},
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = cloudwatch.NewLogAccountPolicy(ctx, "field_index", &cloudwatch.LogAccountPolicyArgs{
			PolicyName:     pulumi.String("field-index"),
			PolicyType:     pulumi.String("FIELD_INDEX_POLICY"),
			PolicyDocument: pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var fieldIndex = new Aws.CloudWatch.LogAccountPolicy("field_index", new()
    {
        PolicyName = "field-index",
        PolicyType = "FIELD_INDEX_POLICY",
        PolicyDocument = JsonSerializer.Serialize(new Dictionary<string, object?>
        {
            ["Fields"] = new[]
            {
                "field1",
                "field2",
            },
        }),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.cloudwatch.LogAccountPolicy;
import com.pulumi.aws.cloudwatch.LogAccountPolicyArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var fieldIndex = new LogAccountPolicy("fieldIndex", LogAccountPolicyArgs.builder()
            .policyName("field-index")
            .policyType("FIELD_INDEX_POLICY")
            .policyDocument(serializeJson(
                jsonObject(
                    jsonProperty("Fields", jsonArray(
                        "field1", 
                        "field2"
                    ))
                )))
            .build());

    }
}
Copy
resources:
  fieldIndex:
    type: aws:cloudwatch:LogAccountPolicy
    name: field_index
    properties:
      policyName: field-index
      policyType: FIELD_INDEX_POLICY
      policyDocument:
        fn::toJSON:
          Fields:
            - field1
            - field2
Copy

Create LogAccountPolicy Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new LogAccountPolicy(name: string, args: LogAccountPolicyArgs, opts?: CustomResourceOptions);
@overload
def LogAccountPolicy(resource_name: str,
                     args: LogAccountPolicyArgs,
                     opts: Optional[ResourceOptions] = None)

@overload
def LogAccountPolicy(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     policy_document: Optional[str] = None,
                     policy_name: Optional[str] = None,
                     policy_type: Optional[str] = None,
                     scope: Optional[str] = None,
                     selection_criteria: Optional[str] = None)
func NewLogAccountPolicy(ctx *Context, name string, args LogAccountPolicyArgs, opts ...ResourceOption) (*LogAccountPolicy, error)
public LogAccountPolicy(string name, LogAccountPolicyArgs args, CustomResourceOptions? opts = null)
public LogAccountPolicy(String name, LogAccountPolicyArgs args)
public LogAccountPolicy(String name, LogAccountPolicyArgs args, CustomResourceOptions options)
type: aws:cloudwatch:LogAccountPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. LogAccountPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. LogAccountPolicyArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. LogAccountPolicyArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. LogAccountPolicyArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. LogAccountPolicyArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var logAccountPolicyResource = new Aws.CloudWatch.LogAccountPolicy("logAccountPolicyResource", new()
{
    PolicyDocument = "string",
    PolicyName = "string",
    PolicyType = "string",
    Scope = "string",
    SelectionCriteria = "string",
});
Copy
example, err := cloudwatch.NewLogAccountPolicy(ctx, "logAccountPolicyResource", &cloudwatch.LogAccountPolicyArgs{
	PolicyDocument:    pulumi.String("string"),
	PolicyName:        pulumi.String("string"),
	PolicyType:        pulumi.String("string"),
	Scope:             pulumi.String("string"),
	SelectionCriteria: pulumi.String("string"),
})
Copy
var logAccountPolicyResource = new LogAccountPolicy("logAccountPolicyResource", LogAccountPolicyArgs.builder()
    .policyDocument("string")
    .policyName("string")
    .policyType("string")
    .scope("string")
    .selectionCriteria("string")
    .build());
Copy
log_account_policy_resource = aws.cloudwatch.LogAccountPolicy("logAccountPolicyResource",
    policy_document="string",
    policy_name="string",
    policy_type="string",
    scope="string",
    selection_criteria="string")
Copy
const logAccountPolicyResource = new aws.cloudwatch.LogAccountPolicy("logAccountPolicyResource", {
    policyDocument: "string",
    policyName: "string",
    policyType: "string",
    scope: "string",
    selectionCriteria: "string",
});
Copy
type: aws:cloudwatch:LogAccountPolicy
properties:
    policyDocument: string
    policyName: string
    policyType: string
    scope: string
    selectionCriteria: string
Copy

LogAccountPolicy Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The LogAccountPolicy resource accepts the following input properties:

PolicyDocument This property is required. string
Text of the account policy. Refer to the AWS docs for more information.
PolicyName
This property is required.
Changes to this property will trigger replacement.
string
Name of the account policy.
PolicyType
This property is required.
Changes to this property will trigger replacement.
string
Type of account policy. One of DATA_PROTECTION_POLICY, SUBSCRIPTION_FILTER_POLICY, FIELD_INDEX_POLICY or TRANSFORMER_POLICY. You can have one account policy per type in an account.
Scope string
Currently defaults to and only accepts the value: ALL.
SelectionCriteria Changes to this property will trigger replacement. string
Criteria for applying a subscription filter policy to a selection of log groups. The only allowable criteria selector is LogGroupName NOT IN [].
PolicyDocument This property is required. string
Text of the account policy. Refer to the AWS docs for more information.
PolicyName
This property is required.
Changes to this property will trigger replacement.
string
Name of the account policy.
PolicyType
This property is required.
Changes to this property will trigger replacement.
string
Type of account policy. One of DATA_PROTECTION_POLICY, SUBSCRIPTION_FILTER_POLICY, FIELD_INDEX_POLICY or TRANSFORMER_POLICY. You can have one account policy per type in an account.
Scope string
Currently defaults to and only accepts the value: ALL.
SelectionCriteria Changes to this property will trigger replacement. string
Criteria for applying a subscription filter policy to a selection of log groups. The only allowable criteria selector is LogGroupName NOT IN [].
policyDocument This property is required. String
Text of the account policy. Refer to the AWS docs for more information.
policyName
This property is required.
Changes to this property will trigger replacement.
String
Name of the account policy.
policyType
This property is required.
Changes to this property will trigger replacement.
String
Type of account policy. One of DATA_PROTECTION_POLICY, SUBSCRIPTION_FILTER_POLICY, FIELD_INDEX_POLICY or TRANSFORMER_POLICY. You can have one account policy per type in an account.
scope String
Currently defaults to and only accepts the value: ALL.
selectionCriteria Changes to this property will trigger replacement. String
Criteria for applying a subscription filter policy to a selection of log groups. The only allowable criteria selector is LogGroupName NOT IN [].
policyDocument This property is required. string
Text of the account policy. Refer to the AWS docs for more information.
policyName
This property is required.
Changes to this property will trigger replacement.
string
Name of the account policy.
policyType
This property is required.
Changes to this property will trigger replacement.
string
Type of account policy. One of DATA_PROTECTION_POLICY, SUBSCRIPTION_FILTER_POLICY, FIELD_INDEX_POLICY or TRANSFORMER_POLICY. You can have one account policy per type in an account.
scope string
Currently defaults to and only accepts the value: ALL.
selectionCriteria Changes to this property will trigger replacement. string
Criteria for applying a subscription filter policy to a selection of log groups. The only allowable criteria selector is LogGroupName NOT IN [].
policy_document This property is required. str
Text of the account policy. Refer to the AWS docs for more information.
policy_name
This property is required.
Changes to this property will trigger replacement.
str
Name of the account policy.
policy_type
This property is required.
Changes to this property will trigger replacement.
str
Type of account policy. One of DATA_PROTECTION_POLICY, SUBSCRIPTION_FILTER_POLICY, FIELD_INDEX_POLICY or TRANSFORMER_POLICY. You can have one account policy per type in an account.
scope str
Currently defaults to and only accepts the value: ALL.
selection_criteria Changes to this property will trigger replacement. str
Criteria for applying a subscription filter policy to a selection of log groups. The only allowable criteria selector is LogGroupName NOT IN [].
policyDocument This property is required. String
Text of the account policy. Refer to the AWS docs for more information.
policyName
This property is required.
Changes to this property will trigger replacement.
String
Name of the account policy.
policyType
This property is required.
Changes to this property will trigger replacement.
String
Type of account policy. One of DATA_PROTECTION_POLICY, SUBSCRIPTION_FILTER_POLICY, FIELD_INDEX_POLICY or TRANSFORMER_POLICY. You can have one account policy per type in an account.
scope String
Currently defaults to and only accepts the value: ALL.
selectionCriteria Changes to this property will trigger replacement. String
Criteria for applying a subscription filter policy to a selection of log groups. The only allowable criteria selector is LogGroupName NOT IN [].

Outputs

All input properties are implicitly available as output properties. Additionally, the LogAccountPolicy resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing LogAccountPolicy Resource

Get an existing LogAccountPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: LogAccountPolicyState, opts?: CustomResourceOptions): LogAccountPolicy
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        policy_document: Optional[str] = None,
        policy_name: Optional[str] = None,
        policy_type: Optional[str] = None,
        scope: Optional[str] = None,
        selection_criteria: Optional[str] = None) -> LogAccountPolicy
func GetLogAccountPolicy(ctx *Context, name string, id IDInput, state *LogAccountPolicyState, opts ...ResourceOption) (*LogAccountPolicy, error)
public static LogAccountPolicy Get(string name, Input<string> id, LogAccountPolicyState? state, CustomResourceOptions? opts = null)
public static LogAccountPolicy get(String name, Output<String> id, LogAccountPolicyState state, CustomResourceOptions options)
resources:  _:    type: aws:cloudwatch:LogAccountPolicy    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
PolicyDocument string
Text of the account policy. Refer to the AWS docs for more information.
PolicyName Changes to this property will trigger replacement. string
Name of the account policy.
PolicyType Changes to this property will trigger replacement. string
Type of account policy. One of DATA_PROTECTION_POLICY, SUBSCRIPTION_FILTER_POLICY, FIELD_INDEX_POLICY or TRANSFORMER_POLICY. You can have one account policy per type in an account.
Scope string
Currently defaults to and only accepts the value: ALL.
SelectionCriteria Changes to this property will trigger replacement. string
Criteria for applying a subscription filter policy to a selection of log groups. The only allowable criteria selector is LogGroupName NOT IN [].
PolicyDocument string
Text of the account policy. Refer to the AWS docs for more information.
PolicyName Changes to this property will trigger replacement. string
Name of the account policy.
PolicyType Changes to this property will trigger replacement. string
Type of account policy. One of DATA_PROTECTION_POLICY, SUBSCRIPTION_FILTER_POLICY, FIELD_INDEX_POLICY or TRANSFORMER_POLICY. You can have one account policy per type in an account.
Scope string
Currently defaults to and only accepts the value: ALL.
SelectionCriteria Changes to this property will trigger replacement. string
Criteria for applying a subscription filter policy to a selection of log groups. The only allowable criteria selector is LogGroupName NOT IN [].
policyDocument String
Text of the account policy. Refer to the AWS docs for more information.
policyName Changes to this property will trigger replacement. String
Name of the account policy.
policyType Changes to this property will trigger replacement. String
Type of account policy. One of DATA_PROTECTION_POLICY, SUBSCRIPTION_FILTER_POLICY, FIELD_INDEX_POLICY or TRANSFORMER_POLICY. You can have one account policy per type in an account.
scope String
Currently defaults to and only accepts the value: ALL.
selectionCriteria Changes to this property will trigger replacement. String
Criteria for applying a subscription filter policy to a selection of log groups. The only allowable criteria selector is LogGroupName NOT IN [].
policyDocument string
Text of the account policy. Refer to the AWS docs for more information.
policyName Changes to this property will trigger replacement. string
Name of the account policy.
policyType Changes to this property will trigger replacement. string
Type of account policy. One of DATA_PROTECTION_POLICY, SUBSCRIPTION_FILTER_POLICY, FIELD_INDEX_POLICY or TRANSFORMER_POLICY. You can have one account policy per type in an account.
scope string
Currently defaults to and only accepts the value: ALL.
selectionCriteria Changes to this property will trigger replacement. string
Criteria for applying a subscription filter policy to a selection of log groups. The only allowable criteria selector is LogGroupName NOT IN [].
policy_document str
Text of the account policy. Refer to the AWS docs for more information.
policy_name Changes to this property will trigger replacement. str
Name of the account policy.
policy_type Changes to this property will trigger replacement. str
Type of account policy. One of DATA_PROTECTION_POLICY, SUBSCRIPTION_FILTER_POLICY, FIELD_INDEX_POLICY or TRANSFORMER_POLICY. You can have one account policy per type in an account.
scope str
Currently defaults to and only accepts the value: ALL.
selection_criteria Changes to this property will trigger replacement. str
Criteria for applying a subscription filter policy to a selection of log groups. The only allowable criteria selector is LogGroupName NOT IN [].
policyDocument String
Text of the account policy. Refer to the AWS docs for more information.
policyName Changes to this property will trigger replacement. String
Name of the account policy.
policyType Changes to this property will trigger replacement. String
Type of account policy. One of DATA_PROTECTION_POLICY, SUBSCRIPTION_FILTER_POLICY, FIELD_INDEX_POLICY or TRANSFORMER_POLICY. You can have one account policy per type in an account.
scope String
Currently defaults to and only accepts the value: ALL.
selectionCriteria Changes to this property will trigger replacement. String
Criteria for applying a subscription filter policy to a selection of log groups. The only allowable criteria selector is LogGroupName NOT IN [].

Import

Using pulumi import, import this resource using the policy_name and policy_type separated by :. For example:

$ pulumi import aws:cloudwatch/logAccountPolicy:LogAccountPolicy example "my-account-policy:SUBSCRIPTION_FILTER_POLICY"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.