Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.gcp.compute.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.RegionSecurityPolicyArgs.builder
import com.pulumi.gcp.compute.kotlin.inputs.RegionSecurityPolicyDdosProtectionConfigArgs
import com.pulumi.gcp.compute.kotlin.inputs.RegionSecurityPolicyDdosProtectionConfigArgsBuilder
import com.pulumi.gcp.compute.kotlin.inputs.RegionSecurityPolicyUserDefinedFieldArgs
import com.pulumi.gcp.compute.kotlin.inputs.RegionSecurityPolicyUserDefinedFieldArgsBuilder
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.collections.List
import kotlin.jvm.JvmName
/**
* ## Example Usage
* ### Region Security Policy Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const region_sec_policy_basic = new gcp.compute.RegionSecurityPolicy("region-sec-policy-basic", {
* name: "my-sec-policy-basic",
* description: "basic region security policy",
* type: "CLOUD_ARMOR",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* region_sec_policy_basic = gcp.compute.RegionSecurityPolicy("region-sec-policy-basic",
* name="my-sec-policy-basic",
* description="basic region security policy",
* type="CLOUD_ARMOR")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var region_sec_policy_basic = new Gcp.Compute.RegionSecurityPolicy("region-sec-policy-basic", new()
* {
* Name = "my-sec-policy-basic",
* Description = "basic region security policy",
* Type = "CLOUD_ARMOR",
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewRegionSecurityPolicy(ctx, "region-sec-policy-basic", &compute.RegionSecurityPolicyArgs{
* Name: pulumi.String("my-sec-policy-basic"),
* Description: pulumi.String("basic region security policy"),
* Type: pulumi.String("CLOUD_ARMOR"),
* })
* 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.gcp.compute.RegionSecurityPolicy;
* import com.pulumi.gcp.compute.RegionSecurityPolicyArgs;
* 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 region_sec_policy_basic = new RegionSecurityPolicy("region-sec-policy-basic", RegionSecurityPolicyArgs.builder()
* .name("my-sec-policy-basic")
* .description("basic region security policy")
* .type("CLOUD_ARMOR")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* region-sec-policy-basic:
* type: gcp:compute:RegionSecurityPolicy
* properties:
* name: my-sec-policy-basic
* description: basic region security policy
* type: CLOUD_ARMOR
* ```
*
* ### Region Security Policy With Ddos Protection Config
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const region_sec_policy_ddos_protection = new gcp.compute.RegionSecurityPolicy("region-sec-policy-ddos-protection", {
* name: "my-sec-policy-ddos-protection",
* description: "with ddos protection config",
* type: "CLOUD_ARMOR_NETWORK",
* ddosProtectionConfig: {
* ddosProtection: "ADVANCED_PREVIEW",
* },
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* region_sec_policy_ddos_protection = gcp.compute.RegionSecurityPolicy("region-sec-policy-ddos-protection",
* name="my-sec-policy-ddos-protection",
* description="with ddos protection config",
* type="CLOUD_ARMOR_NETWORK",
* ddos_protection_config={
* "ddos_protection": "ADVANCED_PREVIEW",
* })
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var region_sec_policy_ddos_protection = new Gcp.Compute.RegionSecurityPolicy("region-sec-policy-ddos-protection", new()
* {
* Name = "my-sec-policy-ddos-protection",
* Description = "with ddos protection config",
* Type = "CLOUD_ARMOR_NETWORK",
* DdosProtectionConfig = new Gcp.Compute.Inputs.RegionSecurityPolicyDdosProtectionConfigArgs
* {
* DdosProtection = "ADVANCED_PREVIEW",
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewRegionSecurityPolicy(ctx, "region-sec-policy-ddos-protection", &compute.RegionSecurityPolicyArgs{
* Name: pulumi.String("my-sec-policy-ddos-protection"),
* Description: pulumi.String("with ddos protection config"),
* Type: pulumi.String("CLOUD_ARMOR_NETWORK"),
* DdosProtectionConfig: &compute.RegionSecurityPolicyDdosProtectionConfigArgs{
* DdosProtection: pulumi.String("ADVANCED_PREVIEW"),
* },
* })
* 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.gcp.compute.RegionSecurityPolicy;
* import com.pulumi.gcp.compute.RegionSecurityPolicyArgs;
* import com.pulumi.gcp.compute.inputs.RegionSecurityPolicyDdosProtectionConfigArgs;
* 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 region_sec_policy_ddos_protection = new RegionSecurityPolicy("region-sec-policy-ddos-protection", RegionSecurityPolicyArgs.builder()
* .name("my-sec-policy-ddos-protection")
* .description("with ddos protection config")
* .type("CLOUD_ARMOR_NETWORK")
* .ddosProtectionConfig(RegionSecurityPolicyDdosProtectionConfigArgs.builder()
* .ddosProtection("ADVANCED_PREVIEW")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* region-sec-policy-ddos-protection:
* type: gcp:compute:RegionSecurityPolicy
* properties:
* name: my-sec-policy-ddos-protection
* description: with ddos protection config
* type: CLOUD_ARMOR_NETWORK
* ddosProtectionConfig:
* ddosProtection: ADVANCED_PREVIEW
* ```
*
* ### Region Security Policy With User Defined Fields
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const region_sec_policy_user_defined_fields = new gcp.compute.RegionSecurityPolicy("region-sec-policy-user-defined-fields", {
* name: "my-sec-policy-user-defined-fields",
* description: "with user defined fields",
* type: "CLOUD_ARMOR_NETWORK",
* userDefinedFields: [
* {
* name: "SIG1_AT_0",
* base: "UDP",
* offset: 8,
* size: 2,
* mask: "0x8F00",
* },
* {
* name: "SIG2_AT_8",
* base: "UDP",
* offset: 16,
* size: 4,
* mask: "0xFFFFFFFF",
* },
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* region_sec_policy_user_defined_fields = gcp.compute.RegionSecurityPolicy("region-sec-policy-user-defined-fields",
* name="my-sec-policy-user-defined-fields",
* description="with user defined fields",
* type="CLOUD_ARMOR_NETWORK",
* user_defined_fields=[
* {
* "name": "SIG1_AT_0",
* "base": "UDP",
* "offset": 8,
* "size": 2,
* "mask": "0x8F00",
* },
* {
* "name": "SIG2_AT_8",
* "base": "UDP",
* "offset": 16,
* "size": 4,
* "mask": "0xFFFFFFFF",
* },
* ])
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var region_sec_policy_user_defined_fields = new Gcp.Compute.RegionSecurityPolicy("region-sec-policy-user-defined-fields", new()
* {
* Name = "my-sec-policy-user-defined-fields",
* Description = "with user defined fields",
* Type = "CLOUD_ARMOR_NETWORK",
* UserDefinedFields = new[]
* {
* new Gcp.Compute.Inputs.RegionSecurityPolicyUserDefinedFieldArgs
* {
* Name = "SIG1_AT_0",
* Base = "UDP",
* Offset = 8,
* Size = 2,
* Mask = "0x8F00",
* },
* new Gcp.Compute.Inputs.RegionSecurityPolicyUserDefinedFieldArgs
* {
* Name = "SIG2_AT_8",
* Base = "UDP",
* Offset = 16,
* Size = 4,
* Mask = "0xFFFFFFFF",
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := compute.NewRegionSecurityPolicy(ctx, "region-sec-policy-user-defined-fields", &compute.RegionSecurityPolicyArgs{
* Name: pulumi.String("my-sec-policy-user-defined-fields"),
* Description: pulumi.String("with user defined fields"),
* Type: pulumi.String("CLOUD_ARMOR_NETWORK"),
* UserDefinedFields: compute.RegionSecurityPolicyUserDefinedFieldArray{
* &compute.RegionSecurityPolicyUserDefinedFieldArgs{
* Name: pulumi.String("SIG1_AT_0"),
* Base: pulumi.String("UDP"),
* Offset: pulumi.Int(8),
* Size: pulumi.Int(2),
* Mask: pulumi.String("0x8F00"),
* },
* &compute.RegionSecurityPolicyUserDefinedFieldArgs{
* Name: pulumi.String("SIG2_AT_8"),
* Base: pulumi.String("UDP"),
* Offset: pulumi.Int(16),
* Size: pulumi.Int(4),
* Mask: pulumi.String("0xFFFFFFFF"),
* },
* },
* })
* 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.gcp.compute.RegionSecurityPolicy;
* import com.pulumi.gcp.compute.RegionSecurityPolicyArgs;
* import com.pulumi.gcp.compute.inputs.RegionSecurityPolicyUserDefinedFieldArgs;
* 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 region_sec_policy_user_defined_fields = new RegionSecurityPolicy("region-sec-policy-user-defined-fields", RegionSecurityPolicyArgs.builder()
* .name("my-sec-policy-user-defined-fields")
* .description("with user defined fields")
* .type("CLOUD_ARMOR_NETWORK")
* .userDefinedFields(
* RegionSecurityPolicyUserDefinedFieldArgs.builder()
* .name("SIG1_AT_0")
* .base("UDP")
* .offset(8)
* .size(2)
* .mask("0x8F00")
* .build(),
* RegionSecurityPolicyUserDefinedFieldArgs.builder()
* .name("SIG2_AT_8")
* .base("UDP")
* .offset(16)
* .size(4)
* .mask("0xFFFFFFFF")
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* region-sec-policy-user-defined-fields:
* type: gcp:compute:RegionSecurityPolicy
* properties:
* name: my-sec-policy-user-defined-fields
* description: with user defined fields
* type: CLOUD_ARMOR_NETWORK
* userDefinedFields:
* - name: SIG1_AT_0
* base: UDP
* offset: 8
* size: 2
* mask: 0x8F00
* - name: SIG2_AT_8
* base: UDP
* offset: 16
* size: 4
* mask: 0xFFFFFFFF
* ```
*
* ## Import
* RegionSecurityPolicy can be imported using any of these accepted formats:
* * `projects/{{project}}/regions/{{region}}/securityPolicies/{{name}}`
* * `{{project}}/{{region}}/{{name}}`
* * `{{region}}/{{name}}`
* * `{{name}}`
* When using the `pulumi import` command, RegionSecurityPolicy can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:compute/regionSecurityPolicy:RegionSecurityPolicy default projects/{{project}}/regions/{{region}}/securityPolicies/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/regionSecurityPolicy:RegionSecurityPolicy default {{project}}/{{region}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/regionSecurityPolicy:RegionSecurityPolicy default {{region}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/regionSecurityPolicy:RegionSecurityPolicy default {{name}}
* ```
* @property ddosProtectionConfig Configuration for Google Cloud Armor DDOS Proctection Config.
* Structure is documented below.
* @property description An optional description of this resource. Provide this property when you create the resource.
* @property name Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.
* Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
* - - -
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @property region The Region in which the created Region Security Policy should reside.
* If it is not provided, the provider region is used.
* @property type The type indicates the intended use of the security policy.
* - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers.
* - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache.
* - CLOUD_ARMOR_NETWORK: Cloud Armor network policies can be configured to filter packets targeting network load balancing resources such as backend services, target pools, target instances, and instances with external IPs. They filter requests before the request is served from the application.
* This field can be set only at resource creation time.
* Possible values are: `CLOUD_ARMOR`, `CLOUD_ARMOR_EDGE`, `CLOUD_ARMOR_NETWORK`.
* @property userDefinedFields Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies.
* A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits.
* Rules may then specify matching values for these fields.
* Structure is documented below.
*/
public data class RegionSecurityPolicyArgs(
public val ddosProtectionConfig: Output? = null,
public val description: Output? = null,
public val name: Output? = null,
public val project: Output? = null,
public val region: Output? = null,
public val type: Output? = null,
public val userDefinedFields: Output>? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.compute.RegionSecurityPolicyArgs =
com.pulumi.gcp.compute.RegionSecurityPolicyArgs.builder()
.ddosProtectionConfig(
ddosProtectionConfig?.applyValue({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}),
)
.description(description?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.project(project?.applyValue({ args0 -> args0 }))
.region(region?.applyValue({ args0 -> args0 }))
.type(type?.applyValue({ args0 -> args0 }))
.userDefinedFields(
userDefinedFields?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
).build()
}
/**
* Builder for [RegionSecurityPolicyArgs].
*/
@PulumiTagMarker
public class RegionSecurityPolicyArgsBuilder internal constructor() {
private var ddosProtectionConfig: Output? = null
private var description: Output? = null
private var name: Output? = null
private var project: Output? = null
private var region: Output? = null
private var type: Output? = null
private var userDefinedFields: Output>? = null
/**
* @param value Configuration for Google Cloud Armor DDOS Proctection Config.
* Structure is documented below.
*/
@JvmName("mfaqdnbqwurrwyhm")
public suspend fun ddosProtectionConfig(`value`: Output) {
this.ddosProtectionConfig = value
}
/**
* @param value An optional description of this resource. Provide this property when you create the resource.
*/
@JvmName("tlgprqhjuawahivx")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035.
* Specifically, the name must be 1-63 characters long and match the regular expression a-z? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
* - - -
*/
@JvmName("sfrhyobvyqqyyslt")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("avmqqkbcqwobjayt")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value The Region in which the created Region Security Policy should reside.
* If it is not provided, the provider region is used.
*/
@JvmName("ecrmpwpdqcuajqxp")
public suspend fun region(`value`: Output) {
this.region = value
}
/**
* @param value The type indicates the intended use of the security policy.
* - CLOUD_ARMOR: Cloud Armor backend security policies can be configured to filter incoming HTTP requests targeting backend services. They filter requests before they hit the origin servers.
* - CLOUD_ARMOR_EDGE: Cloud Armor edge security policies can be configured to filter incoming HTTP requests targeting backend services (including Cloud CDN-enabled) as well as backend buckets (Cloud Storage). They filter requests before the request is served from Google's cache.
* - CLOUD_ARMOR_NETWORK: Cloud Armor network policies can be configured to filter packets targeting network load balancing resources such as backend services, target pools, target instances, and instances with external IPs. They filter requests before the request is served from the application.
* This field can be set only at resource creation time.
* Possible values are: `CLOUD_ARMOR`, `CLOUD_ARMOR_EDGE`, `CLOUD_ARMOR_NETWORK`.
*/
@JvmName("xbrhdcadjfmfdlmg")
public suspend fun type(`value`: Output) {
this.type = value
}
/**
* @param value Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies.
* A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits.
* Rules may then specify matching values for these fields.
* Structure is documented below.
*/
@JvmName("ewfarscktrpymdbt")
public suspend fun userDefinedFields(`value`: Output>) {
this.userDefinedFields = value
}
@JvmName("oomxtpqmnsstvpvh")
public suspend fun userDefinedFields(vararg values: Output) {
this.userDefinedFields = Output.all(values.asList())
}
/**
* @param values Definitions of user-defined fields for CLOUD_ARMOR_NETWORK policies.
* A user-defined field consists of up to 4 bytes extracted from a fixed offset in the packet, relative to the IPv4, IPv6, TCP, or UDP header, with an optional mask to select certain bits.
* Rules may then specify matching values for these fields.
* Structure is documented below.
*/
@JvmName("edvbmhdqtptneurg")
public suspend fun userDefinedFields(values: List