com.pulumi.gcp.compute.kotlin.FirewallPolicyAssociationArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-gcp-kotlin Show documentation
Show all versions of pulumi-gcp-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.gcp.compute.kotlin
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.compute.FirewallPolicyAssociationArgs.builder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* Allows associating hierarchical firewall policies with the target where they are applied. This allows creating policies and rules in a different location than they are applied.
* For more information on applying hierarchical firewall policies see the [official documentation](https://cloud.google.com/vpc/docs/firewall-policies#managing_hierarchical_firewall_policy_resources)
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const _default = new gcp.compute.FirewallPolicy("default", {
* parent: "organizations/12345",
* shortName: "my-policy",
* description: "Example Resource",
* });
* const defaultFirewallPolicyAssociation = new gcp.compute.FirewallPolicyAssociation("default", {
* firewallPolicy: _default.id,
* attachmentTarget: folder.name,
* name: "my-association",
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* default = gcp.compute.FirewallPolicy("default",
* parent="organizations/12345",
* short_name="my-policy",
* description="Example Resource")
* default_firewall_policy_association = gcp.compute.FirewallPolicyAssociation("default",
* firewall_policy=default.id,
* attachment_target=folder["name"],
* name="my-association")
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var @default = new Gcp.Compute.FirewallPolicy("default", new()
* {
* Parent = "organizations/12345",
* ShortName = "my-policy",
* Description = "Example Resource",
* });
* var defaultFirewallPolicyAssociation = new Gcp.Compute.FirewallPolicyAssociation("default", new()
* {
* FirewallPolicy = @default.Id,
* AttachmentTarget = folder.Name,
* Name = "my-association",
* });
* });
* ```
* ```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.NewFirewallPolicy(ctx, "default", &compute.FirewallPolicyArgs{
* Parent: pulumi.String("organizations/12345"),
* ShortName: pulumi.String("my-policy"),
* Description: pulumi.String("Example Resource"),
* })
* if err != nil {
* return err
* }
* _, err = compute.NewFirewallPolicyAssociation(ctx, "default", &compute.FirewallPolicyAssociationArgs{
* FirewallPolicy: _default.ID(),
* AttachmentTarget: pulumi.Any(folder.Name),
* Name: pulumi.String("my-association"),
* })
* 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.FirewallPolicy;
* import com.pulumi.gcp.compute.FirewallPolicyArgs;
* import com.pulumi.gcp.compute.FirewallPolicyAssociation;
* import com.pulumi.gcp.compute.FirewallPolicyAssociationArgs;
* 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 default_ = new FirewallPolicy("default", FirewallPolicyArgs.builder()
* .parent("organizations/12345")
* .shortName("my-policy")
* .description("Example Resource")
* .build());
* var defaultFirewallPolicyAssociation = new FirewallPolicyAssociation("defaultFirewallPolicyAssociation", FirewallPolicyAssociationArgs.builder()
* .firewallPolicy(default_.id())
* .attachmentTarget(folder.name())
* .name("my-association")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* default:
* type: gcp:compute:FirewallPolicy
* properties:
* parent: organizations/12345
* shortName: my-policy
* description: Example Resource
* defaultFirewallPolicyAssociation:
* type: gcp:compute:FirewallPolicyAssociation
* name: default
* properties:
* firewallPolicy: ${default.id}
* attachmentTarget: ${folder.name}
* name: my-association
* ```
*
* ## Import
* FirewallPolicyAssociation can be imported using any of these accepted formats:
* * `locations/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}`
* * `{{firewall_policy}}/{{name}}`
* When using the `pulumi import` command, FirewallPolicyAssociation can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:compute/firewallPolicyAssociation:FirewallPolicyAssociation default locations/global/firewallPolicies/{{firewall_policy}}/associations/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/firewallPolicyAssociation:FirewallPolicyAssociation default {{firewall_policy}}/{{name}}
* ```
* @property attachmentTarget The target that the firewall policy is attached to.
* @property firewallPolicy The firewall policy ID of the association.
* @property name The name for an association.
* - - -
*/
public data class FirewallPolicyAssociationArgs(
public val attachmentTarget: Output? = null,
public val firewallPolicy: Output? = null,
public val name: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.compute.FirewallPolicyAssociationArgs =
com.pulumi.gcp.compute.FirewallPolicyAssociationArgs.builder()
.attachmentTarget(attachmentTarget?.applyValue({ args0 -> args0 }))
.firewallPolicy(firewallPolicy?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [FirewallPolicyAssociationArgs].
*/
@PulumiTagMarker
public class FirewallPolicyAssociationArgsBuilder internal constructor() {
private var attachmentTarget: Output? = null
private var firewallPolicy: Output? = null
private var name: Output? = null
/**
* @param value The target that the firewall policy is attached to.
*/
@JvmName("yqaqmpouvuxbkjje")
public suspend fun attachmentTarget(`value`: Output) {
this.attachmentTarget = value
}
/**
* @param value The firewall policy ID of the association.
*/
@JvmName("phwgaxfvrllnqqfh")
public suspend fun firewallPolicy(`value`: Output) {
this.firewallPolicy = value
}
/**
* @param value The name for an association.
* - - -
*/
@JvmName("sfqhfmwqnpslxnbh")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value The target that the firewall policy is attached to.
*/
@JvmName("njpeqmvoeijevels")
public suspend fun attachmentTarget(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.attachmentTarget = mapped
}
/**
* @param value The firewall policy ID of the association.
*/
@JvmName("ixmmlbdewuuculdu")
public suspend fun firewallPolicy(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.firewallPolicy = mapped
}
/**
* @param value The name for an association.
* - - -
*/
@JvmName("esxgtbntumkgquem")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
internal fun build(): FirewallPolicyAssociationArgs = FirewallPolicyAssociationArgs(
attachmentTarget = attachmentTarget,
firewallPolicy = firewallPolicy,
name = name,
)
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy