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

com.pulumi.cloudflare.kotlin.AddressMapArgs.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: 5.40.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.cloudflare.AddressMapArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.AddressMapIpArgs
import com.pulumi.cloudflare.kotlin.inputs.AddressMapIpArgsBuilder
import com.pulumi.cloudflare.kotlin.inputs.AddressMapMembershipArgs
import com.pulumi.cloudflare.kotlin.inputs.AddressMapMembershipArgsBuilder
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.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Provides the ability to manage IP addresses that can be used by DNS records when
 * they are proxied through Cloudflare.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * const example = new cloudflare.AddressMap("example", {
 *     accountId: "f037e56e89293a057740de681ac9abbe",
 *     description: "My address map",
 *     defaultSni: "*.example.com",
 *     enabled: true,
 *     ips: [
 *         {
 *             ip: "192.0.2.1",
 *         },
 *         {
 *             ip: "203.0.113.1",
 *         },
 *     ],
 *     memberships: [
 *         {
 *             identifier: "92f17202ed8bd63d69a66b86a49a8f6b",
 *             kind: "account",
 *         },
 *         {
 *             identifier: "023e105f4ecef8ad9ca31a8372d0c353",
 *             kind: "zone",
 *         },
 *     ],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * example = cloudflare.AddressMap("example",
 *     account_id="f037e56e89293a057740de681ac9abbe",
 *     description="My address map",
 *     default_sni="*.example.com",
 *     enabled=True,
 *     ips=[
 *         {
 *             "ip": "192.0.2.1",
 *         },
 *         {
 *             "ip": "203.0.113.1",
 *         },
 *     ],
 *     memberships=[
 *         {
 *             "identifier": "92f17202ed8bd63d69a66b86a49a8f6b",
 *             "kind": "account",
 *         },
 *         {
 *             "identifier": "023e105f4ecef8ad9ca31a8372d0c353",
 *             "kind": "zone",
 *         },
 *     ])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Cloudflare.AddressMap("example", new()
 *     {
 *         AccountId = "f037e56e89293a057740de681ac9abbe",
 *         Description = "My address map",
 *         DefaultSni = "*.example.com",
 *         Enabled = true,
 *         Ips = new[]
 *         {
 *             new Cloudflare.Inputs.AddressMapIpArgs
 *             {
 *                 Ip = "192.0.2.1",
 *             },
 *             new Cloudflare.Inputs.AddressMapIpArgs
 *             {
 *                 Ip = "203.0.113.1",
 *             },
 *         },
 *         Memberships = new[]
 *         {
 *             new Cloudflare.Inputs.AddressMapMembershipArgs
 *             {
 *                 Identifier = "92f17202ed8bd63d69a66b86a49a8f6b",
 *                 Kind = "account",
 *             },
 *             new Cloudflare.Inputs.AddressMapMembershipArgs
 *             {
 *                 Identifier = "023e105f4ecef8ad9ca31a8372d0c353",
 *                 Kind = "zone",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		_, err := cloudflare.NewAddressMap(ctx, "example", &cloudflare.AddressMapArgs{
 * 			AccountId:   pulumi.String("f037e56e89293a057740de681ac9abbe"),
 * 			Description: pulumi.String("My address map"),
 * 			DefaultSni:  pulumi.String("*.example.com"),
 * 			Enabled:     pulumi.Bool(true),
 * 			Ips: cloudflare.AddressMapIpArray{
 * 				&cloudflare.AddressMapIpArgs{
 * 					Ip: pulumi.String("192.0.2.1"),
 * 				},
 * 				&cloudflare.AddressMapIpArgs{
 * 					Ip: pulumi.String("203.0.113.1"),
 * 				},
 * 			},
 * 			Memberships: cloudflare.AddressMapMembershipArray{
 * 				&cloudflare.AddressMapMembershipArgs{
 * 					Identifier: pulumi.String("92f17202ed8bd63d69a66b86a49a8f6b"),
 * 					Kind:       pulumi.String("account"),
 * 				},
 * 				&cloudflare.AddressMapMembershipArgs{
 * 					Identifier: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
 * 					Kind:       pulumi.String("zone"),
 * 				},
 * 			},
 * 		})
 * 		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.cloudflare.AddressMap;
 * import com.pulumi.cloudflare.AddressMapArgs;
 * import com.pulumi.cloudflare.inputs.AddressMapIpArgs;
 * import com.pulumi.cloudflare.inputs.AddressMapMembershipArgs;
 * 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 AddressMap("example", AddressMapArgs.builder()
 *             .accountId("f037e56e89293a057740de681ac9abbe")
 *             .description("My address map")
 *             .defaultSni("*.example.com")
 *             .enabled(true)
 *             .ips(
 *                 AddressMapIpArgs.builder()
 *                     .ip("192.0.2.1")
 *                     .build(),
 *                 AddressMapIpArgs.builder()
 *                     .ip("203.0.113.1")
 *                     .build())
 *             .memberships(
 *                 AddressMapMembershipArgs.builder()
 *                     .identifier("92f17202ed8bd63d69a66b86a49a8f6b")
 *                     .kind("account")
 *                     .build(),
 *                 AddressMapMembershipArgs.builder()
 *                     .identifier("023e105f4ecef8ad9ca31a8372d0c353")
 *                     .kind("zone")
 *                     .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: cloudflare:AddressMap
 *     properties:
 *       accountId: f037e56e89293a057740de681ac9abbe
 *       description: My address map
 *       defaultSni: '*.example.com'
 *       enabled: true
 *       ips:
 *         - ip: 192.0.2.1
 *         - ip: 203.0.113.1
 *       memberships:
 *         - identifier: 92f17202ed8bd63d69a66b86a49a8f6b
 *           kind: account
 *         - identifier: 023e105f4ecef8ad9ca31a8372d0c353
 *           kind: zone
 * ```
 * 
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/addressMap:AddressMap example /
 * ```
 * @property accountId The account identifier to target for the resource.
 * @property defaultSni If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map.
 * @property description Description of the address map.
 * @property enabled Whether the Address Map is enabled or not.
 * @property ips The set of IPs on the Address Map.
 * @property memberships Zones and Accounts which will be assigned IPs on this Address Map.
 */
public data class AddressMapArgs(
    public val accountId: Output? = null,
    public val defaultSni: Output? = null,
    public val description: Output? = null,
    public val enabled: Output? = null,
    public val ips: Output>? = null,
    public val memberships: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.AddressMapArgs =
        com.pulumi.cloudflare.AddressMapArgs.builder()
            .accountId(accountId?.applyValue({ args0 -> args0 }))
            .defaultSni(defaultSni?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .enabled(enabled?.applyValue({ args0 -> args0 }))
            .ips(ips?.applyValue({ args0 -> args0.map({ args0 -> args0.let({ args0 -> args0.toJava() }) }) }))
            .memberships(
                memberships?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

/**
 * Builder for [AddressMapArgs].
 */
@PulumiTagMarker
public class AddressMapArgsBuilder internal constructor() {
    private var accountId: Output? = null

    private var defaultSni: Output? = null

    private var description: Output? = null

    private var enabled: Output? = null

    private var ips: Output>? = null

    private var memberships: Output>? = null

    /**
     * @param value The account identifier to target for the resource.
     */
    @JvmName("xlxwadwlfoxlbvle")
    public suspend fun accountId(`value`: Output) {
        this.accountId = value
    }

    /**
     * @param value If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map.
     */
    @JvmName("msfcoiimnfpvpnky")
    public suspend fun defaultSni(`value`: Output) {
        this.defaultSni = value
    }

    /**
     * @param value Description of the address map.
     */
    @JvmName("ooudoiodfndvgqrk")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Whether the Address Map is enabled or not.
     */
    @JvmName("mloedwgekxhkcpmh")
    public suspend fun enabled(`value`: Output) {
        this.enabled = value
    }

    /**
     * @param value The set of IPs on the Address Map.
     */
    @JvmName("bjthxeybmigdqyka")
    public suspend fun ips(`value`: Output>) {
        this.ips = value
    }

    @JvmName("vleapfjluxdinutc")
    public suspend fun ips(vararg values: Output) {
        this.ips = Output.all(values.asList())
    }

    /**
     * @param values The set of IPs on the Address Map.
     */
    @JvmName("lgdtpbofbeqcsrya")
    public suspend fun ips(values: List>) {
        this.ips = Output.all(values)
    }

    /**
     * @param value Zones and Accounts which will be assigned IPs on this Address Map.
     */
    @JvmName("vbwmwynfnuohlmcu")
    public suspend fun memberships(`value`: Output>) {
        this.memberships = value
    }

    @JvmName("gngfujwfgrkrvbuw")
    public suspend fun memberships(vararg values: Output) {
        this.memberships = Output.all(values.asList())
    }

    /**
     * @param values Zones and Accounts which will be assigned IPs on this Address Map.
     */
    @JvmName("hnbvaehqdoiiljjg")
    public suspend fun memberships(values: List>) {
        this.memberships = Output.all(values)
    }

    /**
     * @param value The account identifier to target for the resource.
     */
    @JvmName("vbsbpncibowctpld")
    public suspend fun accountId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.accountId = mapped
    }

    /**
     * @param value If you have legacy TLS clients which do not send the TLS server name indicator, then you can specify one default SNI on the map.
     */
    @JvmName("vlsukwagnlwdakga")
    public suspend fun defaultSni(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.defaultSni = mapped
    }

    /**
     * @param value Description of the address map.
     */
    @JvmName("mlqxhrwwcpllqkgc")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Whether the Address Map is enabled or not.
     */
    @JvmName("iduggqnsuceitwnw")
    public suspend fun enabled(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.enabled = mapped
    }

    /**
     * @param value The set of IPs on the Address Map.
     */
    @JvmName("yxnxdlqimbtalfgl")
    public suspend fun ips(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ips = mapped
    }

    /**
     * @param argument The set of IPs on the Address Map.
     */
    @JvmName("yhrayibbcuyabrcu")
    public suspend fun ips(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AddressMapIpArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.ips = mapped
    }

    /**
     * @param argument The set of IPs on the Address Map.
     */
    @JvmName("uypbwctlwivhywwf")
    public suspend fun ips(vararg argument: suspend AddressMapIpArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AddressMapIpArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.ips = mapped
    }

    /**
     * @param argument The set of IPs on the Address Map.
     */
    @JvmName("dkdokhxgcqctxalo")
    public suspend fun ips(argument: suspend AddressMapIpArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AddressMapIpArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.ips = mapped
    }

    /**
     * @param values The set of IPs on the Address Map.
     */
    @JvmName("qagfovvyqelxcacm")
    public suspend fun ips(vararg values: AddressMapIpArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.ips = mapped
    }

    /**
     * @param value Zones and Accounts which will be assigned IPs on this Address Map.
     */
    @JvmName("pmxvdxbjjxpfflcj")
    public suspend fun memberships(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.memberships = mapped
    }

    /**
     * @param argument Zones and Accounts which will be assigned IPs on this Address Map.
     */
    @JvmName("ofaubxovhhbatcgj")
    public suspend fun memberships(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            AddressMapMembershipArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.memberships = mapped
    }

    /**
     * @param argument Zones and Accounts which will be assigned IPs on this Address Map.
     */
    @JvmName("dmfjfeofwfaxecks")
    public suspend fun memberships(vararg argument: suspend AddressMapMembershipArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            AddressMapMembershipArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.memberships = mapped
    }

    /**
     * @param argument Zones and Accounts which will be assigned IPs on this Address Map.
     */
    @JvmName("quhhaljdiwuoetsj")
    public suspend fun memberships(argument: suspend AddressMapMembershipArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(AddressMapMembershipArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.memberships = mapped
    }

    /**
     * @param values Zones and Accounts which will be assigned IPs on this Address Map.
     */
    @JvmName("pgrtpuedilmkdtkx")
    public suspend fun memberships(vararg values: AddressMapMembershipArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.memberships = mapped
    }

    internal fun build(): AddressMapArgs = AddressMapArgs(
        accountId = accountId,
        defaultSni = defaultSni,
        description = description,
        enabled = enabled,
        ips = ips,
        memberships = memberships,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy