com.pulumi.cloudflare.kotlin.IpsecTunnel.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-cloudflare-kotlin Show documentation
Show all versions of pulumi-cloudflare-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.
The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.cloudflare.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.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [IpsecTunnel].
*/
@PulumiTagMarker
public class IpsecTunnelResourceBuilder internal constructor() {
public var name: String? = null
public var args: IpsecTunnelArgs = IpsecTunnelArgs()
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 IpsecTunnelArgsBuilder.() -> Unit) {
val builder = IpsecTunnelArgsBuilder()
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(): IpsecTunnel {
val builtJavaResource = com.pulumi.cloudflare.IpsecTunnel(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return IpsecTunnel(builtJavaResource)
}
}
/**
* Provides a resource, that manages IPsec tunnels for Magic Transit.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cloudflare from "@pulumi/cloudflare";
* const example = new cloudflare.IpsecTunnel("example", {
* accountId: "f037e56e89293a057740de681ac9abbe",
* name: "IPsec_1",
* customerEndpoint: "203.0.113.1",
* cloudflareEndpoint: "203.0.113.1",
* interfaceAddress: "192.0.2.0/31",
* description: "Tunnel for ISP X",
* healthCheckEnabled: true,
* healthCheckTarget: "203.0.113.1",
* healthCheckType: "reply",
* psk: "asdf12341234",
* allowNullCipher: false,
* });
* ```
* ```python
* import pulumi
* import pulumi_cloudflare as cloudflare
* example = cloudflare.IpsecTunnel("example",
* account_id="f037e56e89293a057740de681ac9abbe",
* name="IPsec_1",
* customer_endpoint="203.0.113.1",
* cloudflare_endpoint="203.0.113.1",
* interface_address="192.0.2.0/31",
* description="Tunnel for ISP X",
* health_check_enabled=True,
* health_check_target="203.0.113.1",
* health_check_type="reply",
* psk="asdf12341234",
* allow_null_cipher=False)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Cloudflare = Pulumi.Cloudflare;
* return await Deployment.RunAsync(() =>
* {
* var example = new Cloudflare.IpsecTunnel("example", new()
* {
* AccountId = "f037e56e89293a057740de681ac9abbe",
* Name = "IPsec_1",
* CustomerEndpoint = "203.0.113.1",
* CloudflareEndpoint = "203.0.113.1",
* InterfaceAddress = "192.0.2.0/31",
* Description = "Tunnel for ISP X",
* HealthCheckEnabled = true,
* HealthCheckTarget = "203.0.113.1",
* HealthCheckType = "reply",
* Psk = "asdf12341234",
* AllowNullCipher = false,
* });
* });
* ```
* ```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.NewIpsecTunnel(ctx, "example", &cloudflare.IpsecTunnelArgs{
* AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
* Name: pulumi.String("IPsec_1"),
* CustomerEndpoint: pulumi.String("203.0.113.1"),
* CloudflareEndpoint: pulumi.String("203.0.113.1"),
* InterfaceAddress: pulumi.String("192.0.2.0/31"),
* Description: pulumi.String("Tunnel for ISP X"),
* HealthCheckEnabled: pulumi.Bool(true),
* HealthCheckTarget: pulumi.String("203.0.113.1"),
* HealthCheckType: pulumi.String("reply"),
* Psk: pulumi.String("asdf12341234"),
* AllowNullCipher: pulumi.Bool(false),
* })
* 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.IpsecTunnel;
* import com.pulumi.cloudflare.IpsecTunnelArgs;
* 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 IpsecTunnel("example", IpsecTunnelArgs.builder()
* .accountId("f037e56e89293a057740de681ac9abbe")
* .name("IPsec_1")
* .customerEndpoint("203.0.113.1")
* .cloudflareEndpoint("203.0.113.1")
* .interfaceAddress("192.0.2.0/31")
* .description("Tunnel for ISP X")
* .healthCheckEnabled(true)
* .healthCheckTarget("203.0.113.1")
* .healthCheckType("reply")
* .psk("asdf12341234")
* .allowNullCipher(false)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: cloudflare:IpsecTunnel
* properties:
* accountId: f037e56e89293a057740de681ac9abbe
* name: IPsec_1
* customerEndpoint: 203.0.113.1
* cloudflareEndpoint: 203.0.113.1
* interfaceAddress: 192.0.2.0/31
* description: Tunnel for ISP X
* healthCheckEnabled: true
* healthCheckTarget: 203.0.113.1
* healthCheckType: reply
* psk: asdf12341234
* allowNullCipher: false
* ```
*
* ## Import
* ```sh
* $ pulumi import cloudflare:index/ipsecTunnel:IpsecTunnel example /
* ```
*/
public class IpsecTunnel internal constructor(
override val javaResource: com.pulumi.cloudflare.IpsecTunnel,
) : KotlinCustomResource(javaResource, IpsecTunnelMapper) {
/**
* The account identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
*/
public val accountId: Output?
get() = javaResource.accountId().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* Specifies if this tunnel may use a null cipher (ENCR_NULL) in Phase 2. Defaults to `false`.
*/
public val allowNullCipher: Output?
get() = javaResource.allowNullCipher().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* IP address assigned to the Cloudflare side of the IPsec tunnel.
*/
public val cloudflareEndpoint: Output
get() = javaResource.cloudflareEndpoint().applyValue({ args0 -> args0 })
/**
* IP address assigned to the customer side of the IPsec tunnel.
*/
public val customerEndpoint: Output
get() = javaResource.customerEndpoint().applyValue({ args0 -> args0 })
/**
* An optional description of the IPsec tunnel.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* `remote_id` in the form of a fqdn. This value is generated by cloudflare.
*/
public val fqdnId: Output
get() = javaResource.fqdnId().applyValue({ args0 -> args0 })
/**
* Specifies the direction for the health check. Available values: `unidirectional`, `bidirectional` Default: `unidirectional`.
*/
public val healthCheckDirection: Output
get() = javaResource.healthCheckDirection().applyValue({ args0 -> args0 })
/**
* Specifies if ICMP tunnel health checks are enabled. Default: `true`.
*/
public val healthCheckEnabled: Output
get() = javaResource.healthCheckEnabled().applyValue({ args0 -> args0 })
/**
* Specifies the ICMP rate for the health check. Available values: `low`, `mid`, `high` Default: `mid`.
*/
public val healthCheckRate: Output
get() = javaResource.healthCheckRate().applyValue({ args0 -> args0 })
/**
* The IP address of the customer endpoint that will receive tunnel health checks. Default: ``.
*/
public val healthCheckTarget: Output
get() = javaResource.healthCheckTarget().applyValue({ args0 -> args0 })
/**
* Specifies the ICMP echo type for the health check (`request` or `reply`). Available values: `request`, `reply` Default: `reply`.
*/
public val healthCheckType: Output
get() = javaResource.healthCheckType().applyValue({ args0 -> args0 })
/**
* `remote_id` as a hex string. This value is generated by cloudflare.
*/
public val hexId: Output
get() = javaResource.hexId().applyValue({ args0 -> args0 })
/**
* 31-bit prefix (/31 in CIDR notation) supporting 2 hosts, one for each side of the tunnel.
*/
public val interfaceAddress: Output
get() = javaResource.interfaceAddress().applyValue({ args0 -> args0 })
/**
* Name of the IPsec tunnel.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* Pre shared key to be used with the IPsec tunnel. If left unset, it will be autogenerated.
*/
public val psk: Output
get() = javaResource.psk().applyValue({ args0 -> args0 })
/**
* ID to be used while setting up the IPsec tunnel. This value is generated by cloudflare.
*/
public val remoteId: Output
get() = javaResource.remoteId().applyValue({ args0 -> args0 })
/**
* Specifies if replay protection is enabled. Defaults to `false`.
*/
public val replayProtection: Output?
get() = javaResource.replayProtection().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* `remote_id` in the form of an email address. This value is generated by cloudflare.
*/
public val userId: Output
get() = javaResource.userId().applyValue({ args0 -> args0 })
}
public object IpsecTunnelMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.cloudflare.IpsecTunnel::class == javaResource::class
override fun map(javaResource: Resource): IpsecTunnel = IpsecTunnel(
javaResource as
com.pulumi.cloudflare.IpsecTunnel,
)
}
/**
* @see [IpsecTunnel].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [IpsecTunnel].
*/
public suspend fun ipsecTunnel(name: String, block: suspend IpsecTunnelResourceBuilder.() -> Unit): IpsecTunnel {
val builder = IpsecTunnelResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [IpsecTunnel].
* @param name The _unique_ name of the resulting resource.
*/
public fun ipsecTunnel(name: String): IpsecTunnel {
val builder = IpsecTunnelResourceBuilder()
builder.name(name)
return builder.build()
}