All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.aws.transfer.kotlin.Agreement.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.57.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.aws.transfer.kotlin

import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map

/**
 * Builder for [Agreement].
 */
@PulumiTagMarker
public class AgreementResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: AgreementArgs = AgreementArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend AgreementArgsBuilder.() -> Unit) {
        val builder = AgreementArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): Agreement {
        val builtJavaResource = com.pulumi.aws.transfer.Agreement(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return Agreement(builtJavaResource)
    }
}

/**
 * Provides a AWS Transfer AS2 Agreement resource.
 * ## Example Usage
 * ### Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * const example = new aws.transfer.Agreement("example", {
 *     accessRole: test.arn,
 *     baseDirectory: "/DOC-EXAMPLE-BUCKET/home/mydirectory",
 *     description: "example",
 *     localProfileId: local.profileId,
 *     partnerProfileId: partner.profileId,
 *     serverId: testAwsTransferServer.id,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * example = aws.transfer.Agreement("example",
 *     access_role=test["arn"],
 *     base_directory="/DOC-EXAMPLE-BUCKET/home/mydirectory",
 *     description="example",
 *     local_profile_id=local["profileId"],
 *     partner_profile_id=partner["profileId"],
 *     server_id=test_aws_transfer_server["id"])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.Transfer.Agreement("example", new()
 *     {
 *         AccessRole = test.Arn,
 *         BaseDirectory = "/DOC-EXAMPLE-BUCKET/home/mydirectory",
 *         Description = "example",
 *         LocalProfileId = local.ProfileId,
 *         PartnerProfileId = partner.ProfileId,
 *         ServerId = testAwsTransferServer.Id,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/transfer"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := transfer.NewAgreement(ctx, "example", &transfer.AgreementArgs{
 * 			AccessRole:       pulumi.Any(test.Arn),
 * 			BaseDirectory:    pulumi.String("/DOC-EXAMPLE-BUCKET/home/mydirectory"),
 * 			Description:      pulumi.String("example"),
 * 			LocalProfileId:   pulumi.Any(local.ProfileId),
 * 			PartnerProfileId: pulumi.Any(partner.ProfileId),
 * 			ServerId:         pulumi.Any(testAwsTransferServer.Id),
 * 		})
 * 		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.transfer.Agreement;
 * import com.pulumi.aws.transfer.AgreementArgs;
 * 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 Agreement("example", AgreementArgs.builder()
 *             .accessRole(test.arn())
 *             .baseDirectory("/DOC-EXAMPLE-BUCKET/home/mydirectory")
 *             .description("example")
 *             .localProfileId(local.profileId())
 *             .partnerProfileId(partner.profileId())
 *             .serverId(testAwsTransferServer.id())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:transfer:Agreement
 *     properties:
 *       accessRole: ${test.arn}
 *       baseDirectory: /DOC-EXAMPLE-BUCKET/home/mydirectory
 *       description: example
 *       localProfileId: ${local.profileId}
 *       partnerProfileId: ${partner.profileId}
 *       serverId: ${testAwsTransferServer.id}
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import Transfer AS2 Agreement using the `server_id/agreement_id`. For example:
 * ```sh
 * $ pulumi import aws:transfer/agreement:Agreement example s-4221a88afd5f4362a/a-4221a88afd5f4362a
 * ```
 */
public class Agreement internal constructor(
    override val javaResource: com.pulumi.aws.transfer.Agreement,
) : KotlinCustomResource(javaResource, AgreementMapper) {
    /**
     * The IAM Role which provides read and write access to the parent directory of the file location mentioned in the StartFileTransfer request.
     */
    public val accessRole: Output
        get() = javaResource.accessRole().applyValue({ args0 -> args0 })

    /**
     * The unique identifier for the AS2 agreement.
     */
    public val agreementId: Output
        get() = javaResource.agreementId().applyValue({ args0 -> args0 })

    /**
     * The ARN of the agreement.
     */
    public val arn: Output
        get() = javaResource.arn().applyValue({ args0 -> args0 })

    /**
     * The landing directory for the files transferred by using the AS2 protocol.
     */
    public val baseDirectory: Output
        get() = javaResource.baseDirectory().applyValue({ args0 -> args0 })

    /**
     * The Optional description of the transdfer.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The unique identifier for the AS2 local profile.
     */
    public val localProfileId: Output
        get() = javaResource.localProfileId().applyValue({ args0 -> args0 })

    /**
     * The unique identifier for the AS2 partner profile.
     */
    public val partnerProfileId: Output
        get() = javaResource.partnerProfileId().applyValue({ args0 -> args0 })

    /**
     * The unique server identifier for the server instance. This is the specific server the agreement uses.
     */
    public val serverId: Output
        get() = javaResource.serverId().applyValue({ args0 -> args0 })

    public val status: Output
        get() = javaResource.status().applyValue({ args0 -> args0 })

    /**
     * A map of tags to assign to the resource. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
     */
    public val tags: Output>?
        get() = javaResource.tags().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    @Deprecated(
        message = """
  Please use `tags` instead.
  """,
    )
    public val tagsAll: Output>
        get() = javaResource.tagsAll().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })
}

public object AgreementMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.transfer.Agreement::class == javaResource::class

    override fun map(javaResource: Resource): Agreement = Agreement(
        javaResource as
            com.pulumi.aws.transfer.Agreement,
    )
}

/**
 * @see [Agreement].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [Agreement].
 */
public suspend fun agreement(name: String, block: suspend AgreementResourceBuilder.() -> Unit): Agreement {
    val builder = AgreementResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [Agreement].
 * @param name The _unique_ name of the resulting resource.
 */
public fun agreement(name: String): Agreement {
    val builder = AgreementResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy