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

com.pulumi.aws.opensearch.kotlin.DomainSamlOptions.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.opensearch.kotlin

import com.pulumi.aws.opensearch.kotlin.outputs.DomainSamlOptionsSamlOptions
import com.pulumi.aws.opensearch.kotlin.outputs.DomainSamlOptionsSamlOptions.Companion.toKotlin
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.String
import kotlin.Suppress
import kotlin.Unit

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

    public var args: DomainSamlOptionsArgs = DomainSamlOptionsArgs()

    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 DomainSamlOptionsArgsBuilder.() -> Unit) {
        val builder = DomainSamlOptionsArgsBuilder()
        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(): DomainSamlOptions {
        val builtJavaResource = com.pulumi.aws.opensearch.DomainSamlOptions(
            this.name,
            this.args.toJava(),
            this.opts.toJava(),
        )
        return DomainSamlOptions(builtJavaResource)
    }
}

/**
 * Manages SAML authentication options for an AWS OpenSearch Domain.
 * ## Example Usage
 * ### Basic Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as aws from "@pulumi/aws";
 * import * as std from "@pulumi/std";
 * const example = new aws.opensearch.Domain("example", {
 *     domainName: "example",
 *     engineVersion: "OpenSearch_1.1",
 *     clusterConfig: {
 *         instanceType: "r4.large.search",
 *     },
 *     snapshotOptions: {
 *         automatedSnapshotStartHour: 23,
 *     },
 *     tags: {
 *         Domain: "TestDomain",
 *     },
 * });
 * const exampleDomainSamlOptions = new aws.opensearch.DomainSamlOptions("example", {
 *     domainName: example.domainName,
 *     samlOptions: {
 *         enabled: true,
 *         idp: {
 *             entityId: "https://example.com",
 *             metadataContent: std.file({
 *                 input: "./saml-metadata.xml",
 *             }).then(invoke => invoke.result),
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_aws as aws
 * import pulumi_std as std
 * example = aws.opensearch.Domain("example",
 *     domain_name="example",
 *     engine_version="OpenSearch_1.1",
 *     cluster_config={
 *         "instance_type": "r4.large.search",
 *     },
 *     snapshot_options={
 *         "automated_snapshot_start_hour": 23,
 *     },
 *     tags={
 *         "Domain": "TestDomain",
 *     })
 * example_domain_saml_options = aws.opensearch.DomainSamlOptions("example",
 *     domain_name=example.domain_name,
 *     saml_options={
 *         "enabled": True,
 *         "idp": {
 *             "entity_id": "https://example.com",
 *             "metadata_content": std.file(input="./saml-metadata.xml").result,
 *         },
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Aws = Pulumi.Aws;
 * using Std = Pulumi.Std;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Aws.OpenSearch.Domain("example", new()
 *     {
 *         DomainName = "example",
 *         EngineVersion = "OpenSearch_1.1",
 *         ClusterConfig = new Aws.OpenSearch.Inputs.DomainClusterConfigArgs
 *         {
 *             InstanceType = "r4.large.search",
 *         },
 *         SnapshotOptions = new Aws.OpenSearch.Inputs.DomainSnapshotOptionsArgs
 *         {
 *             AutomatedSnapshotStartHour = 23,
 *         },
 *         Tags =
 *         {
 *             { "Domain", "TestDomain" },
 *         },
 *     });
 *     var exampleDomainSamlOptions = new Aws.OpenSearch.DomainSamlOptions("example", new()
 *     {
 *         DomainName = example.DomainName,
 *         SamlOptions = new Aws.OpenSearch.Inputs.DomainSamlOptionsSamlOptionsArgs
 *         {
 *             Enabled = true,
 *             Idp = new Aws.OpenSearch.Inputs.DomainSamlOptionsSamlOptionsIdpArgs
 *             {
 *                 EntityId = "https://example.com",
 *                 MetadataContent = Std.File.Invoke(new()
 *                 {
 *                     Input = "./saml-metadata.xml",
 *                 }).Apply(invoke => invoke.Result),
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/opensearch"
 * 	"github.com/pulumi/pulumi-std/sdk/go/std"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := opensearch.NewDomain(ctx, "example", &opensearch.DomainArgs{
 * 			DomainName:    pulumi.String("example"),
 * 			EngineVersion: pulumi.String("OpenSearch_1.1"),
 * 			ClusterConfig: &opensearch.DomainClusterConfigArgs{
 * 				InstanceType: pulumi.String("r4.large.search"),
 * 			},
 * 			SnapshotOptions: &opensearch.DomainSnapshotOptionsArgs{
 * 				AutomatedSnapshotStartHour: pulumi.Int(23),
 * 			},
 * 			Tags: pulumi.StringMap{
 * 				"Domain": pulumi.String("TestDomain"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		invokeFile, err := std.File(ctx, &std.FileArgs{
 * 			Input: "./saml-metadata.xml",
 * 		}, nil)
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = opensearch.NewDomainSamlOptions(ctx, "example", &opensearch.DomainSamlOptionsArgs{
 * 			DomainName: example.DomainName,
 * 			SamlOptions: &opensearch.DomainSamlOptionsSamlOptionsArgs{
 * 				Enabled: pulumi.Bool(true),
 * 				Idp: &opensearch.DomainSamlOptionsSamlOptionsIdpArgs{
 * 					EntityId:        pulumi.String("https://example.com"),
 * 					MetadataContent: pulumi.String(invokeFile.Result),
 * 				},
 * 			},
 * 		})
 * 		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.opensearch.Domain;
 * import com.pulumi.aws.opensearch.DomainArgs;
 * import com.pulumi.aws.opensearch.inputs.DomainClusterConfigArgs;
 * import com.pulumi.aws.opensearch.inputs.DomainSnapshotOptionsArgs;
 * import com.pulumi.aws.opensearch.DomainSamlOptions;
 * import com.pulumi.aws.opensearch.DomainSamlOptionsArgs;
 * import com.pulumi.aws.opensearch.inputs.DomainSamlOptionsSamlOptionsArgs;
 * import com.pulumi.aws.opensearch.inputs.DomainSamlOptionsSamlOptionsIdpArgs;
 * 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 Domain("example", DomainArgs.builder()
 *             .domainName("example")
 *             .engineVersion("OpenSearch_1.1")
 *             .clusterConfig(DomainClusterConfigArgs.builder()
 *                 .instanceType("r4.large.search")
 *                 .build())
 *             .snapshotOptions(DomainSnapshotOptionsArgs.builder()
 *                 .automatedSnapshotStartHour(23)
 *                 .build())
 *             .tags(Map.of("Domain", "TestDomain"))
 *             .build());
 *         var exampleDomainSamlOptions = new DomainSamlOptions("exampleDomainSamlOptions", DomainSamlOptionsArgs.builder()
 *             .domainName(example.domainName())
 *             .samlOptions(DomainSamlOptionsSamlOptionsArgs.builder()
 *                 .enabled(true)
 *                 .idp(DomainSamlOptionsSamlOptionsIdpArgs.builder()
 *                     .entityId("https://example.com")
 *                     .metadataContent(StdFunctions.file(FileArgs.builder()
 *                         .input("./saml-metadata.xml")
 *                         .build()).result())
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: aws:opensearch:Domain
 *     properties:
 *       domainName: example
 *       engineVersion: OpenSearch_1.1
 *       clusterConfig:
 *         instanceType: r4.large.search
 *       snapshotOptions:
 *         automatedSnapshotStartHour: 23
 *       tags:
 *         Domain: TestDomain
 *   exampleDomainSamlOptions:
 *     type: aws:opensearch:DomainSamlOptions
 *     name: example
 *     properties:
 *       domainName: ${example.domainName}
 *       samlOptions:
 *         enabled: true
 *         idp:
 *           entityId: https://example.com
 *           metadataContent:
 *             fn::invoke:
 *               Function: std:file
 *               Arguments:
 *                 input: ./saml-metadata.xml
 *               Return: result
 * ```
 * 
 * ## Import
 * Using `pulumi import`, import OpenSearch domains using the `domain_name`. For example:
 * ```sh
 * $ pulumi import aws:opensearch/domainSamlOptions:DomainSamlOptions example domain_name
 * ```
 */
public class DomainSamlOptions internal constructor(
    override val javaResource: com.pulumi.aws.opensearch.DomainSamlOptions,
) : KotlinCustomResource(javaResource, DomainSamlOptionsMapper) {
    /**
     * Name of the domain.
     * The following arguments are optional:
     */
    public val domainName: Output
        get() = javaResource.domainName().applyValue({ args0 -> args0 })

    /**
     * SAML authentication options for an AWS OpenSearch Domain.
     */
    public val samlOptions: Output?
        get() = javaResource.samlOptions().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    toKotlin(args0)
                })
            }).orElse(null)
        })
}

public object DomainSamlOptionsMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.aws.opensearch.DomainSamlOptions::class == javaResource::class

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy