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.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.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [NetworkFirewallPolicy].
*/
@PulumiTagMarker
public class NetworkFirewallPolicyResourceBuilder internal constructor() {
public var name: String? = null
public var args: NetworkFirewallPolicyArgs = NetworkFirewallPolicyArgs()
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 NetworkFirewallPolicyArgsBuilder.() -> Unit) {
val builder = NetworkFirewallPolicyArgsBuilder()
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(): NetworkFirewallPolicy {
val builtJavaResource = com.pulumi.gcp.compute.NetworkFirewallPolicy(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return NetworkFirewallPolicy(builtJavaResource)
}
}
/**
* The Compute NetworkFirewallPolicy resource
* ## Example Usage
* ### Network Firewall Policy Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const policy = new gcp.compute.NetworkFirewallPolicy("policy", {
* name: "tf-test-policy",
* description: "Terraform test",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* policy = gcp.compute.NetworkFirewallPolicy("policy",
* name="tf-test-policy",
* description="Terraform test")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var policy = new Gcp.Compute.NetworkFirewallPolicy("policy", new()
* {
* Name = "tf-test-policy",
* Description = "Terraform test",
* });
* });
* ```
* ```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.NewNetworkFirewallPolicy(ctx, "policy", &compute.NetworkFirewallPolicyArgs{
* Name: pulumi.String("tf-test-policy"),
* Description: pulumi.String("Terraform test"),
* })
* 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.NetworkFirewallPolicy;
* import com.pulumi.gcp.compute.NetworkFirewallPolicyArgs;
* 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 policy = new NetworkFirewallPolicy("policy", NetworkFirewallPolicyArgs.builder()
* .name("tf-test-policy")
* .description("Terraform test")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* policy:
* type: gcp:compute:NetworkFirewallPolicy
* properties:
* name: tf-test-policy
* description: Terraform test
* ```
*
* ## Import
* NetworkFirewallPolicy can be imported using any of these accepted formats:
* * `projects/{{project}}/global/firewallPolicies/{{name}}`
* * `{{project}}/{{name}}`
* * `{{name}}`
* When using the `pulumi import` command, NetworkFirewallPolicy can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:compute/networkFirewallPolicy:NetworkFirewallPolicy default projects/{{project}}/global/firewallPolicies/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/networkFirewallPolicy:NetworkFirewallPolicy default {{project}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/networkFirewallPolicy:NetworkFirewallPolicy default {{name}}
* ```
*/
public class NetworkFirewallPolicy internal constructor(
override val javaResource: com.pulumi.gcp.compute.NetworkFirewallPolicy,
) : KotlinCustomResource(javaResource, NetworkFirewallPolicyMapper) {
/**
* Creation timestamp in RFC3339 text format.
*/
public val creationTimestamp: Output
get() = javaResource.creationTimestamp().applyValue({ args0 -> args0 })
/**
* An optional description of this resource. Provide this property when you create the resource.
*/
public val description: Output?
get() = javaResource.description().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Fingerprint of the resource. This field is used internally during updates of this resource.
*/
public val fingerprint: Output
get() = javaResource.fingerprint().applyValue({ args0 -> args0 })
/**
* User-provided name of the Network firewall policy. The name should be unique in the project in which the firewall policy 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.
* - - -
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* The unique identifier for the resource. This identifier is defined by the server.
*/
public val networkFirewallPolicyId: Output
get() = javaResource.networkFirewallPolicyId().applyValue({ args0 -> args0 })
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
public val project: Output
get() = javaResource.project().applyValue({ args0 -> args0 })
/**
* Total count of all firewall policy rule tuples. A firewall policy can not exceed a set number of tuples.
*/
public val ruleTupleCount: Output
get() = javaResource.ruleTupleCount().applyValue({ args0 -> args0 })
/**
* Server-defined URL for the resource.
*/
public val selfLink: Output
get() = javaResource.selfLink().applyValue({ args0 -> args0 })
/**
* Server-defined URL for this resource with the resource id.
*/
public val selfLinkWithId: Output
get() = javaResource.selfLinkWithId().applyValue({ args0 -> args0 })
}
public object NetworkFirewallPolicyMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.gcp.compute.NetworkFirewallPolicy::class == javaResource::class
override fun map(javaResource: Resource): NetworkFirewallPolicy =
NetworkFirewallPolicy(javaResource as com.pulumi.gcp.compute.NetworkFirewallPolicy)
}
/**
* @see [NetworkFirewallPolicy].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [NetworkFirewallPolicy].
*/
public suspend fun networkFirewallPolicy(
name: String,
block: suspend NetworkFirewallPolicyResourceBuilder.() -> Unit,
): NetworkFirewallPolicy {
val builder = NetworkFirewallPolicyResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [NetworkFirewallPolicy].
* @param name The _unique_ name of the resulting resource.
*/
public fun networkFirewallPolicy(name: String): NetworkFirewallPolicy {
val builder = NetworkFirewallPolicyResourceBuilder()
builder.name(name)
return builder.build()
}