UNPKG

@pulumi/aws

Version:

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

129 lines 6.11 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.ReplicationConfiguration = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Creates a replica of an existing EFS file system in the same or another region. Creating this resource causes the source EFS file system to be replicated to a new read-only destination EFS file system (unless using the `destination.file_system_id` attribute). Deleting this resource will cause the replication from source to destination to stop and the destination file system will no longer be read only. * * > **NOTE:** Deleting this resource does **not** delete the destination file system that was created. * * ## Example Usage * * Will create a replica using regional storage in us-west-2 that will be encrypted by the default EFS KMS key `/aws/elasticfilesystem`. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.efs.FileSystem("example", {}); * const exampleReplicationConfiguration = new aws.efs.ReplicationConfiguration("example", { * sourceFileSystemId: example.id, * destination: { * region: "us-west-2", * }, * }); * ``` * * Replica will be created as One Zone storage in the us-west-2b Availability Zone and encrypted with the specified KMS key. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.efs.FileSystem("example", {}); * const exampleReplicationConfiguration = new aws.efs.ReplicationConfiguration("example", { * sourceFileSystemId: example.id, * destination: { * availabilityZoneName: "us-west-2b", * kmsKeyId: "1234abcd-12ab-34cd-56ef-1234567890ab", * }, * }); * ``` * * Will create a replica and set the existing file system with id `fs-1234567890` in us-west-2 as destination. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.efs.FileSystem("example", {}); * const exampleReplicationConfiguration = new aws.efs.ReplicationConfiguration("example", { * sourceFileSystemId: example.id, * destination: { * fileSystemId: "fs-1234567890", * region: "us-west-2", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import EFS Replication Configurations using the file system ID of either the source or destination file system. When importing, the `availability_zone_name` and `kms_key_id` attributes must __not__ be set in the configuration. The AWS API does not return these values when querying the replication configuration and their presence will therefore show as a diff in a subsequent plan. For example: * * ```sh * $ pulumi import aws:efs/replicationConfiguration:ReplicationConfiguration example fs-id * ``` */ class ReplicationConfiguration extends pulumi.CustomResource { /** * Get an existing ReplicationConfiguration 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 ReplicationConfiguration(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ReplicationConfiguration. 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'] === ReplicationConfiguration.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["creationTime"] = state?.creationTime; resourceInputs["destination"] = state?.destination; resourceInputs["originalSourceFileSystemArn"] = state?.originalSourceFileSystemArn; resourceInputs["region"] = state?.region; resourceInputs["sourceFileSystemArn"] = state?.sourceFileSystemArn; resourceInputs["sourceFileSystemId"] = state?.sourceFileSystemId; resourceInputs["sourceFileSystemRegion"] = state?.sourceFileSystemRegion; } else { const args = argsOrState; if (args?.destination === undefined && !opts.urn) { throw new Error("Missing required property 'destination'"); } if (args?.sourceFileSystemId === undefined && !opts.urn) { throw new Error("Missing required property 'sourceFileSystemId'"); } resourceInputs["destination"] = args?.destination; resourceInputs["region"] = args?.region; resourceInputs["sourceFileSystemId"] = args?.sourceFileSystemId; resourceInputs["creationTime"] = undefined /*out*/; resourceInputs["originalSourceFileSystemArn"] = undefined /*out*/; resourceInputs["sourceFileSystemArn"] = undefined /*out*/; resourceInputs["sourceFileSystemRegion"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ReplicationConfiguration.__pulumiType, name, resourceInputs, opts); } } exports.ReplicationConfiguration = ReplicationConfiguration; /** @internal */ ReplicationConfiguration.__pulumiType = 'aws:efs/replicationConfiguration:ReplicationConfiguration'; //# sourceMappingURL=replicationConfiguration.js.map