UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

138 lines (137 loc) 5.69 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; /** * Provides a resource to manage a CloudWatch log resource policy. * * ## Example Usage * * ### Elasticsearch Log Publishing * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const elasticsearch_log_publishing_policy = aws.iam.getPolicyDocument({ * statements: [{ * actions: [ * "logs:CreateLogStream", * "logs:PutLogEvents", * "logs:PutLogEventsBatch", * ], * resources: ["arn:aws:logs:*"], * principals: [{ * identifiers: ["es.amazonaws.com"], * type: "Service", * }], * }], * }); * const elasticsearch_log_publishing_policyLogResourcePolicy = new aws.cloudwatch.LogResourcePolicy("elasticsearch-log-publishing-policy", { * policyDocument: elasticsearch_log_publishing_policy.then(elasticsearch_log_publishing_policy => elasticsearch_log_publishing_policy.json), * policyName: "elasticsearch-log-publishing-policy", * }); * ``` * * ### Route53 Query Logging * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const route53_query_logging_policy = aws.iam.getPolicyDocument({ * statements: [{ * actions: [ * "logs:CreateLogStream", * "logs:PutLogEvents", * ], * resources: ["arn:aws:logs:*:*:log-group:/aws/route53/*"], * principals: [{ * identifiers: ["route53.amazonaws.com"], * type: "Service", * }], * }], * }); * const route53_query_logging_policyLogResourcePolicy = new aws.cloudwatch.LogResourcePolicy("route53-query-logging-policy", { * policyDocument: route53_query_logging_policy.then(route53_query_logging_policy => route53_query_logging_policy.json), * policyName: "route53-query-logging-policy", * }); * ``` * * ## Import * * Using `pulumi import`, import CloudWatch log resource policies using the policy name. For example: * * ```sh * $ pulumi import aws:cloudwatch/logResourcePolicy:LogResourcePolicy MyPolicy MyPolicy * ``` */ export declare class LogResourcePolicy extends pulumi.CustomResource { /** * Get an existing LogResourcePolicy resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: LogResourcePolicyState, opts?: pulumi.CustomResourceOptions): LogResourcePolicy; /** * Returns true if the given object is an instance of LogResourcePolicy. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is LogResourcePolicy; /** * Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters. */ readonly policyDocument: pulumi.Output<string>; /** * Name of the resource policy. */ readonly policyName: pulumi.Output<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output<string>; /** * Create a LogResourcePolicy resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: LogResourcePolicyArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering LogResourcePolicy resources. */ export interface LogResourcePolicyState { /** * Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters. */ policyDocument?: pulumi.Input<string | inputs.cloudwatch.PolicyDocument>; /** * Name of the resource policy. */ policyName?: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; } /** * The set of arguments for constructing a LogResourcePolicy resource. */ export interface LogResourcePolicyArgs { /** * Details of the resource policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. Maximum length of 5120 characters. */ policyDocument: pulumi.Input<string | inputs.cloudwatch.PolicyDocument>; /** * Name of the resource policy. */ policyName: pulumi.Input<string>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; }