com.pulumi.aws.efs.kotlin.BackupPolicyArgs.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.BackupPolicyArgs.builder
import com.pulumi.aws.efs.kotlin.inputs.BackupPolicyBackupPolicyArgs
import com.pulumi.aws.efs.kotlin.inputs.BackupPolicyBackupPolicyArgsBuilder
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
/**
* Provides an Elastic File System (EFS) Backup Policy resource.
* Backup policies turn automatic backups on or off for an existing file system.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
* const fs = new aws.efs.FileSystem("fs", {creationToken: "my-product"});
* const policy = new aws.efs.BackupPolicy("policy", {
* fileSystemId: fs.id,
* backupPolicy: {
* status: "ENABLED",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_aws as aws
* fs = aws.efs.FileSystem("fs", creation_token="my-product")
* policy = aws.efs.BackupPolicy("policy",
* file_system_id=fs.id,
* backup_policy={
* "status": "ENABLED",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Aws = Pulumi.Aws;
* return await Deployment.RunAsync(() =>
* {
* var fs = new Aws.Efs.FileSystem("fs", new()
* {
* CreationToken = "my-product",
* });
* var policy = new Aws.Efs.BackupPolicy("policy", new()
* {
* FileSystemId = fs.Id,
* BackupPolicyDetails = new Aws.Efs.Inputs.BackupPolicyBackupPolicyArgs
* {
* Status = "ENABLED",
* },
* });
* });
* ```
* ```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 {
* fs, err := efs.NewFileSystem(ctx, "fs", &efs.FileSystemArgs{
* CreationToken: pulumi.String("my-product"),
* })
* if err != nil {
* return err
* }
* _, err = efs.NewBackupPolicy(ctx, "policy", &efs.BackupPolicyArgs{
* FileSystemId: fs.ID(),
* BackupPolicy: &efs.BackupPolicyBackupPolicyArgs{
* Status: pulumi.String("ENABLED"),
* },
* })
* 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.FileSystemArgs;
* import com.pulumi.aws.efs.BackupPolicy;
* import com.pulumi.aws.efs.BackupPolicyArgs;
* import com.pulumi.aws.efs.inputs.BackupPolicyBackupPolicyArgs;
* 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 fs = new FileSystem("fs", FileSystemArgs.builder()
* .creationToken("my-product")
* .build());
* var policy = new BackupPolicy("policy", BackupPolicyArgs.builder()
* .fileSystemId(fs.id())
* .backupPolicy(BackupPolicyBackupPolicyArgs.builder()
* .status("ENABLED")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* fs:
* type: aws:efs:FileSystem
* properties:
* creationToken: my-product
* policy:
* type: aws:efs:BackupPolicy
* properties:
* fileSystemId: ${fs.id}
* backupPolicy:
* status: ENABLED
* ```
*
* ## Import
* Using `pulumi import`, import the EFS backup policies using the `id`. For example:
* ```sh
* $ pulumi import aws:efs/backupPolicy:BackupPolicy example fs-6fa144c6
* ```
* @property backupPolicy A backup_policy object (documented below).
* @property fileSystemId The ID of the EFS file system.
*/
public data class BackupPolicyArgs(
public val backupPolicy: Output? = null,
public val fileSystemId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.aws.efs.BackupPolicyArgs =
com.pulumi.aws.efs.BackupPolicyArgs.builder()
.backupPolicy(backupPolicy?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.fileSystemId(fileSystemId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [BackupPolicyArgs].
*/
@PulumiTagMarker
public class BackupPolicyArgsBuilder internal constructor() {
private var backupPolicy: Output? = null
private var fileSystemId: Output? = null
/**
* @param value A backup_policy object (documented below).
*/
@JvmName("uewsaosihuxibrdv")
public suspend fun backupPolicy(`value`: Output) {
this.backupPolicy = value
}
/**
* @param value The ID of the EFS file system.
*/
@JvmName("wjmudotbwcespsvi")
public suspend fun fileSystemId(`value`: Output) {
this.fileSystemId = value
}
/**
* @param value A backup_policy object (documented below).
*/
@JvmName("vmqamyhwoppngyme")
public suspend fun backupPolicy(`value`: BackupPolicyBackupPolicyArgs?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.backupPolicy = mapped
}
/**
* @param argument A backup_policy object (documented below).
*/
@JvmName("ujdjyvrcivdiiotx")
public suspend fun backupPolicy(argument: suspend BackupPolicyBackupPolicyArgsBuilder.() -> Unit) {
val toBeMapped = BackupPolicyBackupPolicyArgsBuilder().applySuspend { argument() }.build()
val mapped = of(toBeMapped)
this.backupPolicy = mapped
}
/**
* @param value The ID of the EFS file system.
*/
@JvmName("edeilsuceytqfffn")
public suspend fun fileSystemId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.fileSystemId = mapped
}
internal fun build(): BackupPolicyArgs = BackupPolicyArgs(
backupPolicy = backupPolicy,
fileSystemId = fileSystemId,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy