UNPKG

@pulumi/aws

Version:

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

133 lines 5 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.RealtimeLogConfig = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a CloudFront real-time log configuration resource. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const assumeRole = aws.iam.getPolicyDocument({ * statements: [{ * effect: "Allow", * principals: [{ * type: "Service", * identifiers: ["cloudfront.amazonaws.com"], * }], * actions: ["sts:AssumeRole"], * }], * }); * const exampleRole = new aws.iam.Role("example", { * name: "cloudfront-realtime-log-config-example", * assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json), * }); * const example = aws.iam.getPolicyDocument({ * statements: [{ * effect: "Allow", * actions: [ * "kinesis:DescribeStreamSummary", * "kinesis:DescribeStream", * "kinesis:PutRecord", * "kinesis:PutRecords", * ], * resources: [exampleAwsKinesisStream.arn], * }], * }); * const exampleRolePolicy = new aws.iam.RolePolicy("example", { * name: "cloudfront-realtime-log-config-example", * role: exampleRole.id, * policy: example.then(example => example.json), * }); * const exampleRealtimeLogConfig = new aws.cloudfront.RealtimeLogConfig("example", { * name: "example", * samplingRate: 75, * fields: [ * "timestamp", * "c-ip", * ], * endpoint: { * streamType: "Kinesis", * kinesisStreamConfig: { * roleArn: exampleRole.arn, * streamArn: exampleAwsKinesisStream.arn, * }, * }, * }, { * dependsOn: [exampleRolePolicy], * }); * ``` * * ## Import * * Using `pulumi import`, import CloudFront real-time log configurations using the ARN. For example: * * ```sh * $ pulumi import aws:cloudfront/realtimeLogConfig:RealtimeLogConfig example arn:aws:cloudfront::111122223333:realtime-log-config/ExampleNameForRealtimeLogConfig * ``` */ class RealtimeLogConfig extends pulumi.CustomResource { /** * Get an existing RealtimeLogConfig 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, id, state, opts) { return new RealtimeLogConfig(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of RealtimeLogConfig. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === RealtimeLogConfig.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["endpoint"] = state?.endpoint; resourceInputs["fields"] = state?.fields; resourceInputs["name"] = state?.name; resourceInputs["samplingRate"] = state?.samplingRate; } else { const args = argsOrState; if (args?.endpoint === undefined && !opts.urn) { throw new Error("Missing required property 'endpoint'"); } if (args?.fields === undefined && !opts.urn) { throw new Error("Missing required property 'fields'"); } if (args?.samplingRate === undefined && !opts.urn) { throw new Error("Missing required property 'samplingRate'"); } resourceInputs["endpoint"] = args?.endpoint; resourceInputs["fields"] = args?.fields; resourceInputs["name"] = args?.name; resourceInputs["samplingRate"] = args?.samplingRate; resourceInputs["arn"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(RealtimeLogConfig.__pulumiType, name, resourceInputs, opts); } } exports.RealtimeLogConfig = RealtimeLogConfig; /** @internal */ RealtimeLogConfig.__pulumiType = 'aws:cloudfront/realtimeLogConfig:RealtimeLogConfig'; //# sourceMappingURL=realtimeLogConfig.js.map