com.pulumi.cloudflare.kotlin.ZoneLockdownArgs.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.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.cloudflare.kotlin
import com.pulumi.cloudflare.ZoneLockdownArgs.builder
import com.pulumi.cloudflare.kotlin.inputs.ZoneLockdownConfigurationArgs
import com.pulumi.cloudflare.kotlin.inputs.ZoneLockdownConfigurationArgsBuilder
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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Provides a Cloudflare Zone Lockdown resource. Zone Lockdown allows
* you to define one or more URLs (with wildcard matching on the domain
* or path) that will only permit access if the request originates
* from an IP address that matches a safelist of one or more IP
* addresses and/or IP ranges.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as cloudflare from "@pulumi/cloudflare";
* // Restrict access to these endpoints to requests from a known IP address range.
* const example = new cloudflare.ZoneLockdown("example", {
* zoneId: "0da42c8d2132a9ddaf714f9e7c920711",
* paused: false,
* description: "Restrict access to these endpoints to requests from a known IP address range",
* urls: ["api.mysite.com/some/endpoint*"],
* configurations: [{
* target: "ip_range",
* value: "192.0.2.0/24",
* }],
* });
* ```
* ```python
* import pulumi
* import pulumi_cloudflare as cloudflare
* # Restrict access to these endpoints to requests from a known IP address range.
* example = cloudflare.ZoneLockdown("example",
* zone_id="0da42c8d2132a9ddaf714f9e7c920711",
* paused=False,
* description="Restrict access to these endpoints to requests from a known IP address range",
* urls=["api.mysite.com/some/endpoint*"],
* configurations=[{
* "target": "ip_range",
* "value": "192.0.2.0/24",
* }])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Cloudflare = Pulumi.Cloudflare;
* return await Deployment.RunAsync(() =>
* {
* // Restrict access to these endpoints to requests from a known IP address range.
* var example = new Cloudflare.ZoneLockdown("example", new()
* {
* ZoneId = "0da42c8d2132a9ddaf714f9e7c920711",
* Paused = false,
* Description = "Restrict access to these endpoints to requests from a known IP address range",
* Urls = new[]
* {
* "api.mysite.com/some/endpoint*",
* },
* Configurations = new[]
* {
* new Cloudflare.Inputs.ZoneLockdownConfigurationArgs
* {
* Target = "ip_range",
* Value = "192.0.2.0/24",
* },
* },
* });
* });
* ```
* ```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 {
* // Restrict access to these endpoints to requests from a known IP address range.
* _, err := cloudflare.NewZoneLockdown(ctx, "example", &cloudflare.ZoneLockdownArgs{
* ZoneId: pulumi.String("0da42c8d2132a9ddaf714f9e7c920711"),
* Paused: pulumi.Bool(false),
* Description: pulumi.String("Restrict access to these endpoints to requests from a known IP address range"),
* Urls: pulumi.StringArray{
* pulumi.String("api.mysite.com/some/endpoint*"),
* },
* Configurations: cloudflare.ZoneLockdownConfigurationArray{
* &cloudflare.ZoneLockdownConfigurationArgs{
* Target: pulumi.String("ip_range"),
* Value: pulumi.String("192.0.2.0/24"),
* },
* },
* })
* 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.ZoneLockdown;
* import com.pulumi.cloudflare.ZoneLockdownArgs;
* import com.pulumi.cloudflare.inputs.ZoneLockdownConfigurationArgs;
* 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) {
* // Restrict access to these endpoints to requests from a known IP address range.
* var example = new ZoneLockdown("example", ZoneLockdownArgs.builder()
* .zoneId("0da42c8d2132a9ddaf714f9e7c920711")
* .paused("false")
* .description("Restrict access to these endpoints to requests from a known IP address range")
* .urls("api.mysite.com/some/endpoint*")
* .configurations(ZoneLockdownConfigurationArgs.builder()
* .target("ip_range")
* .value("192.0.2.0/24")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* # Restrict access to these endpoints to requests from a known IP address range.
* example:
* type: cloudflare:ZoneLockdown
* properties:
* zoneId: 0da42c8d2132a9ddaf714f9e7c920711
* paused: 'false'
* description: Restrict access to these endpoints to requests from a known IP address range
* urls:
* - api.mysite.com/some/endpoint*
* configurations:
* - target: ip_range
* value: 192.0.2.0/24
* ```
*
* ## Import
* ```sh
* $ pulumi import cloudflare:index/zoneLockdown:ZoneLockdown example /
* ```
* @property configurations A list of IP addresses or IP ranges to match the request against specified in target, value pairs.
* @property description A description about the lockdown entry. Typically used as a reminder or explanation for the lockdown.
* @property paused Boolean of whether this zone lockdown is currently paused. Defaults to `false`.
* @property priority
* @property urls A list of simple wildcard patterns to match requests against. The order of the urls is unimportant.
* @property zoneId The zone identifier to target for the resource. **Modifying this attribute will force creation of a new resource.**
*/
public data class ZoneLockdownArgs(
public val configurations: Output>? = null,
public val description: Output? = null,
public val paused: Output? = null,
public val priority: Output? = null,
public val urls: Output>? = null,
public val zoneId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.cloudflare.ZoneLockdownArgs =
com.pulumi.cloudflare.ZoneLockdownArgs.builder()
.configurations(
configurations?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.description(description?.applyValue({ args0 -> args0 }))
.paused(paused?.applyValue({ args0 -> args0 }))
.priority(priority?.applyValue({ args0 -> args0 }))
.urls(urls?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.zoneId(zoneId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ZoneLockdownArgs].
*/
@PulumiTagMarker
public class ZoneLockdownArgsBuilder internal constructor() {
private var configurations: Output>? = null
private var description: Output? = null
private var paused: Output? = null
private var priority: Output? = null
private var urls: Output>? = null
private var zoneId: Output? = null
/**
* @param value A list of IP addresses or IP ranges to match the request against specified in target, value pairs.
*/
@JvmName("cpmkloadqsthryvk")
public suspend fun configurations(`value`: Output>) {
this.configurations = value
}
@JvmName("neirypcnjrrxfkmr")
public suspend fun configurations(vararg values: Output) {
this.configurations = Output.all(values.asList())
}
/**
* @param values A list of IP addresses or IP ranges to match the request against specified in target, value pairs.
*/
@JvmName("yruaofiseinopsam")
public suspend fun configurations(values: List