com.pulumi.aws.efs.kotlin.ReplicationConfigurationArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-kotlin Show documentation
Show all versions of pulumi-aws-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.aws.efs.kotlin
import com.pulumi.aws.efs.ReplicationConfigurationArgs.builder
import com.pulumi.aws.efs.kotlin.inputs.ReplicationConfigurationDestinationArgs
import com.pulumi.aws.efs.kotlin.inputs.ReplicationConfigurationDestinationArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.jvm.JvmName
/**
* 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",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.efs.FileSystem("example")
* example_replication_configuration = aws.efs.ReplicationConfiguration("example",
* source_file_system_id=example.id,
* destination={
* "region": "us-west-2",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.Efs.FileSystem("example");
* var exampleReplicationConfiguration = new Aws.Efs.ReplicationConfiguration("example", new()
* {
* SourceFileSystemId = example.Id,
* Destination = new Aws.Efs.Inputs.ReplicationConfigurationDestinationArgs
* {
* Region = "us-west-2",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/efs"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := efs.NewFileSystem(ctx, "example", nil)
* if err != nil {
* return err
* }
* _, err = efs.NewReplicationConfiguration(ctx, "example", &efs.ReplicationConfigurationArgs{
* SourceFileSystemId: example.ID(),
* Destination: &efs.ReplicationConfigurationDestinationArgs{
* Region: pulumi.String("us-west-2"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.efs.FileSystem;
* import com.pulumi.aws.efs.ReplicationConfiguration;
* import com.pulumi.aws.efs.ReplicationConfigurationArgs;
* import com.pulumi.aws.efs.inputs.ReplicationConfigurationDestinationArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new FileSystem("example");
* var exampleReplicationConfiguration = new ReplicationConfiguration("exampleReplicationConfiguration", ReplicationConfigurationArgs.builder()
* .sourceFileSystemId(example.id())
* .destination(ReplicationConfigurationDestinationArgs.builder()
* .region("us-west-2")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:efs:FileSystem
* exampleReplicationConfiguration:
* type: aws:efs:ReplicationConfiguration
* name: example
* properties:
* 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",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.efs.FileSystem("example")
* example_replication_configuration = aws.efs.ReplicationConfiguration("example",
* source_file_system_id=example.id,
* destination={
* "availability_zone_name": "us-west-2b",
* "kms_key_id": "1234abcd-12ab-34cd-56ef-1234567890ab",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.Efs.FileSystem("example");
* var exampleReplicationConfiguration = new Aws.Efs.ReplicationConfiguration("example", new()
* {
* SourceFileSystemId = example.Id,
* Destination = new Aws.Efs.Inputs.ReplicationConfigurationDestinationArgs
* {
* AvailabilityZoneName = "us-west-2b",
* KmsKeyId = "1234abcd-12ab-34cd-56ef-1234567890ab",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/efs"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := efs.NewFileSystem(ctx, "example", nil)
* if err != nil {
* return err
* }
* _, err = efs.NewReplicationConfiguration(ctx, "example", &efs.ReplicationConfigurationArgs{
* SourceFileSystemId: example.ID(),
* Destination: &efs.ReplicationConfigurationDestinationArgs{
* AvailabilityZoneName: pulumi.String("us-west-2b"),
* KmsKeyId: pulumi.String("1234abcd-12ab-34cd-56ef-1234567890ab"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.efs.FileSystem;
* import com.pulumi.aws.efs.ReplicationConfiguration;
* import com.pulumi.aws.efs.ReplicationConfigurationArgs;
* import com.pulumi.aws.efs.inputs.ReplicationConfigurationDestinationArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new FileSystem("example");
* var exampleReplicationConfiguration = new ReplicationConfiguration("exampleReplicationConfiguration", ReplicationConfigurationArgs.builder()
* .sourceFileSystemId(example.id())
* .destination(ReplicationConfigurationDestinationArgs.builder()
* .availabilityZoneName("us-west-2b")
* .kmsKeyId("1234abcd-12ab-34cd-56ef-1234567890ab")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:efs:FileSystem
* exampleReplicationConfiguration:
* type: aws:efs:ReplicationConfiguration
* name: example
* properties:
* 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",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* example = aws.efs.FileSystem("example")
* example_replication_configuration = aws.efs.ReplicationConfiguration("example",
* source_file_system_id=example.id,
* destination={
* "file_system_id": "fs-1234567890",
* "region": "us-west-2",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var example = new Aws.Efs.FileSystem("example");
* var exampleReplicationConfiguration = new Aws.Efs.ReplicationConfiguration("example", new()
* {
* SourceFileSystemId = example.Id,
* Destination = new Aws.Efs.Inputs.ReplicationConfigurationDestinationArgs
* {
* FileSystemId = "fs-1234567890",
* Region = "us-west-2",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/efs"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := efs.NewFileSystem(ctx, "example", nil)
* if err != nil {
* return err
* }
* _, err = efs.NewReplicationConfiguration(ctx, "example", &efs.ReplicationConfigurationArgs{
* SourceFileSystemId: example.ID(),
* Destination: &efs.ReplicationConfigurationDestinationArgs{
* FileSystemId: pulumi.String("fs-1234567890"),
* Region: pulumi.String("us-west-2"),
* },
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.aws.efs.FileSystem;
* import com.pulumi.aws.efs.ReplicationConfiguration;
* import com.pulumi.aws.efs.ReplicationConfigurationArgs;
* import com.pulumi.aws.efs.inputs.ReplicationConfigurationDestinationArgs;
* import java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
* public static void stack(Context ctx) {
* var example = new FileSystem("example");
* var exampleReplicationConfiguration = new ReplicationConfiguration("exampleReplicationConfiguration", ReplicationConfigurationArgs.builder()
* .sourceFileSystemId(example.id())
* .destination(ReplicationConfigurationDestinationArgs.builder()
* .fileSystemId("fs-1234567890")
* .region("us-west-2")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: aws:efs:FileSystem
* exampleReplicationConfiguration:
* type: aws:efs:ReplicationConfiguration
* name: example
* properties:
* 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
* ```
* @property destination A destination configuration block (documented below).
* @property sourceFileSystemId The ID of the file system that is to be replicated.
*/
public data class ReplicationConfigurationArgs(
public val destination: Output? = null,
public val sourceFileSystemId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.efs.ReplicationConfigurationArgs =
com.pulumi.aws.efs.ReplicationConfigurationArgs.builder()
.destination(destination?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.sourceFileSystemId(sourceFileSystemId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ReplicationConfigurationArgs].
*/
@PulumiTagMarker
public class ReplicationConfigurationArgsBuilder internal constructor() {
private var destination: Output? = null
private var sourceFileSystemId: Output? = null
/**
* @param value A destination configuration block (documented below).
*/
@JvmName("ldljoqposgtscdvp")
public suspend fun destination(`value`: Output) {
this.destination = value
}
/**
* @param value The ID of the file system that is to be replicated.
*/
@JvmName("nsbahdftrnvunsus")
public suspend fun sourceFileSystemId(`value`: Output) {
this.sourceFileSystemId = value
}
/**
* @param value A destination configuration block (documented below).
*/
@JvmName("tpcvcwdffgheyvqv")
public suspend fun destination(`value`: ReplicationConfigurationDestinationArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.destination = mapped
}
/**
* @param argument A destination configuration block (documented below).
*/
@JvmName("mwvvcaqvdpfkqary")
public suspend fun destination(argument: suspend ReplicationConfigurationDestinationArgsBuilder.() -> Unit) {
val toBeMapped = ReplicationConfigurationDestinationArgsBuilder().applySuspend {
argument()
}.build()
val mapped = of(toBeMapped)
this.destination = mapped
}
/**
* @param value The ID of the file system that is to be replicated.
*/
@JvmName("pemwexltwqqqokqx")
public suspend fun sourceFileSystemId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.sourceFileSystemId = mapped
}
internal fun build(): ReplicationConfigurationArgs = ReplicationConfigurationArgs(
destination = destination,
sourceFileSystemId = sourceFileSystemId,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy