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

com.pulumi.cloudflare.kotlin.InfrastructureAccessTargetArgs.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.cloudflare.kotlin

import com.pulumi.cloudflare.InfrastructureAccessTargetArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.InfrastructureAccessTargetIpArgs
import com.pulumi.cloudflare.kotlin.inputs.InfrastructureAccessTargetIpArgsBuilder
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

/**
 * The [Infrastructure Access Target](https://developers.cloudflare.com/cloudflare-one/insights/risk-score/) resource allows you to configure Cloudflare Risk Behaviors for an account.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as cloudflare from "@pulumi/cloudflare";
 * const example = new cloudflare.InfrastructureAccessTarget("example", {
 *     accountId: "f037e56e89293a057740de681ac9abbe",
 *     hostname: "example-target",
 *     ip: {
 *         ipv4: {
 *             ipAddr: "210.26.29.230",
 *             virtualNetworkId: "238dccd1-149b-463d-8228-560ab83a54fd",
 *         },
 *         ipv6: {
 *             ipAddr: "24c0:64e8:f0b4:8dbf:7104:72b0:ef8f:f5e0",
 *             virtualNetworkId: "238dccd1-149b-463d-8228-560ab83a54fd",
 *         },
 *     },
 * });
 * const ipv4OnlyExample = new cloudflare.InfrastructureAccessTarget("ipv4_only_example", {
 *     accountId: "f037e56e89293a057740de681ac9abbe",
 *     hostname: "example-ipv4-only",
 *     ip: {
 *         ipv4: {
 *             ipAddr: "210.26.29.230",
 *             virtualNetworkId: "238dccd1-149b-463d-8228-560ab83a54fd",
 *         },
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_cloudflare as cloudflare
 * example = cloudflare.InfrastructureAccessTarget("example",
 *     account_id="f037e56e89293a057740de681ac9abbe",
 *     hostname="example-target",
 *     ip={
 *         "ipv4": {
 *             "ip_addr": "210.26.29.230",
 *             "virtual_network_id": "238dccd1-149b-463d-8228-560ab83a54fd",
 *         },
 *         "ipv6": {
 *             "ip_addr": "24c0:64e8:f0b4:8dbf:7104:72b0:ef8f:f5e0",
 *             "virtual_network_id": "238dccd1-149b-463d-8228-560ab83a54fd",
 *         },
 *     })
 * ipv4_only_example = cloudflare.InfrastructureAccessTarget("ipv4_only_example",
 *     account_id="f037e56e89293a057740de681ac9abbe",
 *     hostname="example-ipv4-only",
 *     ip={
 *         "ipv4": {
 *             "ip_addr": "210.26.29.230",
 *             "virtual_network_id": "238dccd1-149b-463d-8228-560ab83a54fd",
 *         },
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Cloudflare = Pulumi.Cloudflare;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Cloudflare.InfrastructureAccessTarget("example", new()
 *     {
 *         AccountId = "f037e56e89293a057740de681ac9abbe",
 *         Hostname = "example-target",
 *         Ip = new Cloudflare.Inputs.InfrastructureAccessTargetIpArgs
 *         {
 *             Ipv4 = new Cloudflare.Inputs.InfrastructureAccessTargetIpIpv4Args
 *             {
 *                 IpAddr = "210.26.29.230",
 *                 VirtualNetworkId = "238dccd1-149b-463d-8228-560ab83a54fd",
 *             },
 *             Ipv6 = new Cloudflare.Inputs.InfrastructureAccessTargetIpIpv6Args
 *             {
 *                 IpAddr = "24c0:64e8:f0b4:8dbf:7104:72b0:ef8f:f5e0",
 *                 VirtualNetworkId = "238dccd1-149b-463d-8228-560ab83a54fd",
 *             },
 *         },
 *     });
 *     var ipv4OnlyExample = new Cloudflare.InfrastructureAccessTarget("ipv4_only_example", new()
 *     {
 *         AccountId = "f037e56e89293a057740de681ac9abbe",
 *         Hostname = "example-ipv4-only",
 *         Ip = new Cloudflare.Inputs.InfrastructureAccessTargetIpArgs
 *         {
 *             Ipv4 = new Cloudflare.Inputs.InfrastructureAccessTargetIpIpv4Args
 *             {
 *                 IpAddr = "210.26.29.230",
 *                 VirtualNetworkId = "238dccd1-149b-463d-8228-560ab83a54fd",
 *             },
 *         },
 *     });
 * });
 * ```
 * ```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.NewInfrastructureAccessTarget(ctx, "example", &cloudflare.InfrastructureAccessTargetArgs{
 * 			AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
 * 			Hostname:  pulumi.String("example-target"),
 * 			Ip: &cloudflare.InfrastructureAccessTargetIpArgs{
 * 				Ipv4: &cloudflare.InfrastructureAccessTargetIpIpv4Args{
 * 					IpAddr:           pulumi.String("210.26.29.230"),
 * 					VirtualNetworkId: pulumi.String("238dccd1-149b-463d-8228-560ab83a54fd"),
 * 				},
 * 				Ipv6: &cloudflare.InfrastructureAccessTargetIpIpv6Args{
 * 					IpAddr:           pulumi.String("24c0:64e8:f0b4:8dbf:7104:72b0:ef8f:f5e0"),
 * 					VirtualNetworkId: pulumi.String("238dccd1-149b-463d-8228-560ab83a54fd"),
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = cloudflare.NewInfrastructureAccessTarget(ctx, "ipv4_only_example", &cloudflare.InfrastructureAccessTargetArgs{
 * 			AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
 * 			Hostname:  pulumi.String("example-ipv4-only"),
 * 			Ip: &cloudflare.InfrastructureAccessTargetIpArgs{
 * 				Ipv4: &cloudflare.InfrastructureAccessTargetIpIpv4Args{
 * 					IpAddr:           pulumi.String("210.26.29.230"),
 * 					VirtualNetworkId: pulumi.String("238dccd1-149b-463d-8228-560ab83a54fd"),
 * 				},
 * 			},
 * 		})
 * 		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.InfrastructureAccessTarget;
 * import com.pulumi.cloudflare.InfrastructureAccessTargetArgs;
 * import com.pulumi.cloudflare.inputs.InfrastructureAccessTargetIpArgs;
 * import com.pulumi.cloudflare.inputs.InfrastructureAccessTargetIpIpv4Args;
 * import com.pulumi.cloudflare.inputs.InfrastructureAccessTargetIpIpv6Args;
 * 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 InfrastructureAccessTarget("example", InfrastructureAccessTargetArgs.builder()
 *             .accountId("f037e56e89293a057740de681ac9abbe")
 *             .hostname("example-target")
 *             .ip(InfrastructureAccessTargetIpArgs.builder()
 *                 .ipv4(InfrastructureAccessTargetIpIpv4Args.builder()
 *                     .ipAddr("210.26.29.230")
 *                     .virtualNetworkId("238dccd1-149b-463d-8228-560ab83a54fd")
 *                     .build())
 *                 .ipv6(InfrastructureAccessTargetIpIpv6Args.builder()
 *                     .ipAddr("24c0:64e8:f0b4:8dbf:7104:72b0:ef8f:f5e0")
 *                     .virtualNetworkId("238dccd1-149b-463d-8228-560ab83a54fd")
 *                     .build())
 *                 .build())
 *             .build());
 *         var ipv4OnlyExample = new InfrastructureAccessTarget("ipv4OnlyExample", InfrastructureAccessTargetArgs.builder()
 *             .accountId("f037e56e89293a057740de681ac9abbe")
 *             .hostname("example-ipv4-only")
 *             .ip(InfrastructureAccessTargetIpArgs.builder()
 *                 .ipv4(InfrastructureAccessTargetIpIpv4Args.builder()
 *                     .ipAddr("210.26.29.230")
 *                     .virtualNetworkId("238dccd1-149b-463d-8228-560ab83a54fd")
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: cloudflare:InfrastructureAccessTarget
 *     properties:
 *       accountId: f037e56e89293a057740de681ac9abbe
 *       hostname: example-target
 *       ip:
 *         ipv4:
 *           ipAddr: 210.26.29.230
 *           virtualNetworkId: 238dccd1-149b-463d-8228-560ab83a54fd
 *         ipv6:
 *           ipAddr: 24c0:64e8:f0b4:8dbf:7104:72b0:ef8f:f5e0
 *           virtualNetworkId: 238dccd1-149b-463d-8228-560ab83a54fd
 *   ipv4OnlyExample:
 *     type: cloudflare:InfrastructureAccessTarget
 *     name: ipv4_only_example
 *     properties:
 *       accountId: f037e56e89293a057740de681ac9abbe
 *       hostname: example-ipv4-only
 *       ip:
 *         ipv4:
 *           ipAddr: 210.26.29.230
 *           virtualNetworkId: 238dccd1-149b-463d-8228-560ab83a54fd
 * ```
 * 
 * ## Import
 * ```sh
 * $ pulumi import cloudflare:index/infrastructureAccessTarget:InfrastructureAccessTarget example 
 * ```
 * @property accountId The account identifier to target for the resource.
 * @property hostname A non-unique field that refers to a target.
 * @property ip The IPv4/IPv6 address that identifies where to reach a target.
 */
public data class InfrastructureAccessTargetArgs(
    public val accountId: Output? = null,
    public val hostname: Output? = null,
    public val ip: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.cloudflare.InfrastructureAccessTargetArgs =
        com.pulumi.cloudflare.InfrastructureAccessTargetArgs.builder()
            .accountId(accountId?.applyValue({ args0 -> args0 }))
            .hostname(hostname?.applyValue({ args0 -> args0 }))
            .ip(ip?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}

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

    private var hostname: Output? = null

    private var ip: Output? = null

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

    /**
     * @param value A non-unique field that refers to a target.
     */
    @JvmName("hoximsqqnwrpwnae")
    public suspend fun hostname(`value`: Output) {
        this.hostname = value
    }

    /**
     * @param value The IPv4/IPv6 address that identifies where to reach a target.
     */
    @JvmName("ipbxdjednyvyfxfs")
    public suspend fun ip(`value`: Output) {
        this.ip = value
    }

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

    /**
     * @param value A non-unique field that refers to a target.
     */
    @JvmName("afeufpcfwgbfhctx")
    public suspend fun hostname(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hostname = mapped
    }

    /**
     * @param value The IPv4/IPv6 address that identifies where to reach a target.
     */
    @JvmName("ommnrfiutjnbxftk")
    public suspend fun ip(`value`: InfrastructureAccessTargetIpArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.ip = mapped
    }

    /**
     * @param argument The IPv4/IPv6 address that identifies where to reach a target.
     */
    @JvmName("hrplgvdumejpcyun")
    public suspend fun ip(argument: suspend InfrastructureAccessTargetIpArgsBuilder.() -> Unit) {
        val toBeMapped = InfrastructureAccessTargetIpArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.ip = mapped
    }

    internal fun build(): InfrastructureAccessTargetArgs = InfrastructureAccessTargetArgs(
        accountId = accountId,
        hostname = hostname,
        ip = ip,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy