@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
190 lines • 7.53 kB
JavaScript
// *** 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.Integration = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing a DynamoDB zero-ETL integration or S3 event integration with Amazon Redshift. You can refer to the [User Guide](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/RedshiftforDynamoDB-zero-etl.html) for a DynamoDB zero-ETL integration or the [User Guide](https://docs.aws.amazon.com/redshift/latest/dg/loading-data-copy-job.html) for a S3 event integration.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.dynamodb.Table("example", {
* name: "dynamodb-table-example",
* readCapacity: 1,
* writeCapacity: 1,
* hashKey: "example",
* attributes: [{
* name: "example",
* type: "S",
* }],
* pointInTimeRecovery: {
* enabled: true,
* },
* });
* const exampleNamespace = new aws.redshiftserverless.Namespace("example", {namespaceName: "redshift-example"});
* const exampleWorkgroup = new aws.redshiftserverless.Workgroup("example", {
* namespaceName: exampleNamespace.namespaceName,
* workgroupName: "example-workgroup",
* baseCapacity: 8,
* publiclyAccessible: false,
* subnetIds: [
* example1.id,
* example2.id,
* example3.id,
* ],
* configParameters: [{
* parameterKey: "enable_case_sensitive_identifier",
* parameterValue: "true",
* }],
* });
* const exampleIntegration = new aws.redshift.Integration("example", {
* integrationName: "example",
* sourceArn: example.arn,
* targetArn: exampleNamespace.arn,
* });
* ```
*
* ### Use own KMS key
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getCallerIdentity({});
* const example = new aws.kms.Key("example", {
* description: "example",
* deletionWindowInDays: 10,
* });
* const exampleKeyPolicy = new aws.kms.KeyPolicy("example", {
* keyId: example.id,
* policy: JSON.stringify({
* Version: "2008-10-17",
* Statement: [
* {
* Effect: "Allow",
* Principal: {
* AWS: current.then(current => `arn:aws:iam::${current.accountId}:root`),
* },
* Action: "kms:*",
* Resource: "*",
* },
* {
* Effect: "Allow",
* Principal: {
* Service: "redshift.amazonaws.com",
* },
* Action: [
* "kms:Decrypt",
* "kms:CreateGrant",
* ],
* Resource: "*",
* Condition: {
* StringEquals: {
* "aws:SourceAccount": current.then(current => current.accountId),
* },
* ArnEquals: {
* "aws:SourceArn": current.then(current => `arn:aws:redshift:*:${current.accountId}:integration:*`),
* },
* },
* },
* ],
* }),
* });
* const exampleIntegration = new aws.redshift.Integration("example", {
* integrationName: "example",
* sourceArn: exampleAwsDynamodbTable.arn,
* targetArn: exampleAwsRedshiftserverlessNamespace.arn,
* kmsKeyId: example.arn,
* additionalEncryptionContext: {
* example: "test",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Redshift Integration using the `arn`. For example:
*
* ```sh
* $ pulumi import aws:redshift/integration:Integration example arn:aws:redshift:us-west-2:123456789012:integration:abcdefgh-0000-1111-2222-123456789012
* ```
*/
class Integration extends pulumi.CustomResource {
/**
* Get an existing Integration 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 Integration(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Integration. 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'] === Integration.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["additionalEncryptionContext"] = state?.additionalEncryptionContext;
resourceInputs["arn"] = state?.arn;
resourceInputs["description"] = state?.description;
resourceInputs["integrationName"] = state?.integrationName;
resourceInputs["kmsKeyId"] = state?.kmsKeyId;
resourceInputs["region"] = state?.region;
resourceInputs["sourceArn"] = state?.sourceArn;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["targetArn"] = state?.targetArn;
resourceInputs["timeouts"] = state?.timeouts;
}
else {
const args = argsOrState;
if (args?.integrationName === undefined && !opts.urn) {
throw new Error("Missing required property 'integrationName'");
}
if (args?.sourceArn === undefined && !opts.urn) {
throw new Error("Missing required property 'sourceArn'");
}
if (args?.targetArn === undefined && !opts.urn) {
throw new Error("Missing required property 'targetArn'");
}
resourceInputs["additionalEncryptionContext"] = args?.additionalEncryptionContext;
resourceInputs["description"] = args?.description;
resourceInputs["integrationName"] = args?.integrationName;
resourceInputs["kmsKeyId"] = args?.kmsKeyId;
resourceInputs["region"] = args?.region;
resourceInputs["sourceArn"] = args?.sourceArn;
resourceInputs["tags"] = args?.tags;
resourceInputs["targetArn"] = args?.targetArn;
resourceInputs["timeouts"] = args?.timeouts;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Integration.__pulumiType, name, resourceInputs, opts);
}
}
exports.Integration = Integration;
/** @internal */
Integration.__pulumiType = 'aws:redshift/integration:Integration';
//# sourceMappingURL=integration.js.map
;