UNPKG

@pulumi/aws

Version:

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

122 lines 5.76 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.ClusterActivityStream = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages RDS Aurora Cluster Database Activity Streams. * * Database Activity Streams have some limits and requirements, refer to the [Monitoring Amazon Aurora using Database Activity Streams](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/DBActivityStreams.html) documentation for detailed limitations and requirements. * * > **Note:** This resource always calls the RDS [`StartActivityStream`][2] API with the `ApplyImmediately` parameter set to `true`. This is because the provider needs the activity stream to be started in order for it to get the associated attributes. * * > **Note:** This resource depends on having at least one `aws.rds.ClusterInstance` created. To avoid race conditions when all resources are being created together, add an explicit resource reference using the resource `dependsOn` meta-argument. * * > **Note:** This resource is available in all regions except the following: `cn-north-1`, `cn-northwest-1`, `us-gov-east-1`, `us-gov-west-1` * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const _default = new aws.rds.Cluster("default", { * clusterIdentifier: "aurora-cluster-demo", * availabilityZones: [ * "us-west-2a", * "us-west-2b", * "us-west-2c", * ], * databaseName: "mydb", * masterUsername: "foo", * masterPassword: "mustbeeightcharaters", * engine: aws.rds.EngineType.AuroraPostgresql, * engineVersion: "13.4", * }); * const defaultClusterInstance = new aws.rds.ClusterInstance("default", { * identifier: "aurora-instance-demo", * clusterIdentifier: _default.clusterIdentifier, * engine: _default.engine.apply((x) => aws.rds.EngineType[x]), * instanceClass: aws.rds.InstanceType.R6G_Large, * }); * const defaultKey = new aws.kms.Key("default", {description: "AWS KMS Key to encrypt Database Activity Stream"}); * const defaultClusterActivityStream = new aws.rds.ClusterActivityStream("default", { * resourceArn: _default.arn, * mode: "async", * kmsKeyId: defaultKey.keyId, * }, { * dependsOn: [defaultClusterInstance], * }); * ``` * * ## Import * * Using `pulumi import`, import RDS Aurora Cluster Database Activity Streams using the `resource_arn`. For example: * * ```sh * $ pulumi import aws:rds/clusterActivityStream:ClusterActivityStream default arn:aws:rds:us-west-2:123456789012:cluster:aurora-cluster-demo * ``` */ class ClusterActivityStream extends pulumi.CustomResource { /** * Get an existing ClusterActivityStream 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 ClusterActivityStream(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ClusterActivityStream. 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'] === ClusterActivityStream.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["engineNativeAuditFieldsIncluded"] = state?.engineNativeAuditFieldsIncluded; resourceInputs["kinesisStreamName"] = state?.kinesisStreamName; resourceInputs["kmsKeyId"] = state?.kmsKeyId; resourceInputs["mode"] = state?.mode; resourceInputs["region"] = state?.region; resourceInputs["resourceArn"] = state?.resourceArn; } else { const args = argsOrState; if (args?.kmsKeyId === undefined && !opts.urn) { throw new Error("Missing required property 'kmsKeyId'"); } if (args?.mode === undefined && !opts.urn) { throw new Error("Missing required property 'mode'"); } if (args?.resourceArn === undefined && !opts.urn) { throw new Error("Missing required property 'resourceArn'"); } resourceInputs["engineNativeAuditFieldsIncluded"] = args?.engineNativeAuditFieldsIncluded; resourceInputs["kmsKeyId"] = args?.kmsKeyId; resourceInputs["mode"] = args?.mode; resourceInputs["region"] = args?.region; resourceInputs["resourceArn"] = args?.resourceArn; resourceInputs["kinesisStreamName"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ClusterActivityStream.__pulumiType, name, resourceInputs, opts); } } exports.ClusterActivityStream = ClusterActivityStream; /** @internal */ ClusterActivityStream.__pulumiType = 'aws:rds/clusterActivityStream:ClusterActivityStream'; //# sourceMappingURL=clusterActivityStream.js.map