InterceptEndpointGroupAssociationNetworksecurity class

An endpoint group association represents a link between a network and an endpoint group in the organization.

Creating an association creates the networking infrastructure linking the network to the endpoint group, but does not enable intercept by itself. To enable intercept, the user must also create a network firewall policy containing intercept rules and associate it with the network.

Example Usage

Network Security Intercept Endpoint Group Association Basic

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const producerNetwork = new gcp.compute.Network("producer_network", {
    name: "example-prod-network",
    autoCreateSubnetworks: false,
});
const consumerNetwork = new gcp.compute.Network("consumer_network", {
    name: "example-cons-network",
    autoCreateSubnetworks: false,
});
const deploymentGroup = new gcp.networksecurity.InterceptDeploymentGroup("deployment_group", {
    interceptDeploymentGroupId: "example-dg",
    location: "global",
    network: producerNetwork.id,
});
const endpointGroup = new gcp.networksecurity.InterceptEndpointGroup("endpoint_group", {
    interceptEndpointGroupId: "example-eg",
    location: "global",
    interceptDeploymentGroup: deploymentGroup.id,
});
const _default = new gcp.networksecurity.InterceptEndpointGroupAssociation("default", {
    interceptEndpointGroupAssociationId: "example-ega",
    location: "global",
    network: consumerNetwork.id,
    interceptEndpointGroup: endpointGroup.id,
    labels: {
        foo: "bar",
    },
});
import pulumi
import pulumi_gcp as gcp

producer_network = gcp.compute.Network("producer_network",
    name="example-prod-network",
    auto_create_subnetworks=False)
consumer_network = gcp.compute.Network("consumer_network",
    name="example-cons-network",
    auto_create_subnetworks=False)
deployment_group = gcp.networksecurity.InterceptDeploymentGroup("deployment_group",
    intercept_deployment_group_id="example-dg",
    location="global",
    network=producer_network.id)
endpoint_group = gcp.networksecurity.InterceptEndpointGroup("endpoint_group",
    intercept_endpoint_group_id="example-eg",
    location="global",
    intercept_deployment_group=deployment_group.id)
default = gcp.networksecurity.InterceptEndpointGroupAssociation("default",
    intercept_endpoint_group_association_id="example-ega",
    location="global",
    network=consumer_network.id,
    intercept_endpoint_group=endpoint_group.id,
    labels={
        "foo": "bar",
    })
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var producerNetwork = new Gcp.Compute.Network("producer_network", new()
    {
        Name = "example-prod-network",
        AutoCreateSubnetworks = false,
    });

    var consumerNetwork = new Gcp.Compute.Network("consumer_network", new()
    {
        Name = "example-cons-network",
        AutoCreateSubnetworks = false,
    });

    var deploymentGroup = new Gcp.NetworkSecurity.InterceptDeploymentGroup("deployment_group", new()
    {
        InterceptDeploymentGroupId = "example-dg",
        Location = "global",
        Network = producerNetwork.Id,
    });

    var endpointGroup = new Gcp.NetworkSecurity.InterceptEndpointGroup("endpoint_group", new()
    {
        InterceptEndpointGroupId = "example-eg",
        Location = "global",
        InterceptDeploymentGroup = deploymentGroup.Id,
    });

    var @default = new Gcp.NetworkSecurity.InterceptEndpointGroupAssociation("default", new()
    {
        InterceptEndpointGroupAssociationId = "example-ega",
        Location = "global",
        Network = consumerNetwork.Id,
        InterceptEndpointGroup = endpointGroup.Id,
        Labels =
        {
            { "foo", "bar" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/networksecurity"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		producerNetwork, err := compute.NewNetwork(ctx, "producer_network", &compute.NetworkArgs{
			Name:                  pulumi.String("example-prod-network"),
			AutoCreateSubnetworks: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		consumerNetwork, err := compute.NewNetwork(ctx, "consumer_network", &compute.NetworkArgs{
			Name:                  pulumi.String("example-cons-network"),
			AutoCreateSubnetworks: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		deploymentGroup, err := networksecurity.NewInterceptDeploymentGroup(ctx, "deployment_group", &networksecurity.InterceptDeploymentGroupArgs{
			InterceptDeploymentGroupId: pulumi.String("example-dg"),
			Location:                   pulumi.String("global"),
			Network:                    producerNetwork.ID().ToIDOutput().ToStringOutput(),
		})
		if err != nil {
			return err
		}
		endpointGroup, err := networksecurity.NewInterceptEndpointGroup(ctx, "endpoint_group", &networksecurity.InterceptEndpointGroupArgs{
			InterceptEndpointGroupId: pulumi.String("example-eg"),
			Location:                 pulumi.String("global"),
			InterceptDeploymentGroup: deploymentGroup.ID().ToIDOutput().ToStringOutput(),
		})
		if err != nil {
			return err
		}
		_, err = networksecurity.NewInterceptEndpointGroupAssociation(ctx, "default", &networksecurity.InterceptEndpointGroupAssociationArgs{
			InterceptEndpointGroupAssociationId: pulumi.String("example-ega"),
			Location:                            pulumi.String("global"),
			Network:                             consumerNetwork.ID().ToIDOutput().ToStringOutput(),
			InterceptEndpointGroup:              endpointGroup.ID().ToIDOutput().ToStringOutput(),
			Labels: pulumi.StringMap{
				"foo": pulumi.String("bar"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_compute_network" "producer_network" {
  name                    = "example-prod-network"
  auto_create_subnetworks = false
}
resource "gcp_compute_network" "consumer_network" {
  name                    = "example-cons-network"
  auto_create_subnetworks = false
}
resource "gcp_networksecurity_interceptdeploymentgroup" "deployment_group" {
  intercept_deployment_group_id = "example-dg"
  location                      = "global"
  network                       = gcp_compute_network.producer_network.id
}
resource "gcp_networksecurity_interceptendpointgroup" "endpoint_group" {
  intercept_endpoint_group_id = "example-eg"
  location                    = "global"
  intercept_deployment_group  = gcp_networksecurity_interceptdeploymentgroup.deployment_group.id
}
resource "gcp_networksecurity_interceptendpointgroupassociation" "default" {
  intercept_endpoint_group_association_id = "example-ega"
  location                                = "global"
  network                                 = gcp_compute_network.consumer_network.id
  intercept_endpoint_group                = gcp_networksecurity_interceptendpointgroup.endpoint_group.id
  labels = {
    "foo" = "bar"
  }
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.networksecurity.InterceptDeploymentGroup;
import com.pulumi.gcp.networksecurity.InterceptDeploymentGroupArgs;
import com.pulumi.gcp.networksecurity.InterceptEndpointGroup;
import com.pulumi.gcp.networksecurity.InterceptEndpointGroupArgs;
import com.pulumi.gcp.networksecurity.InterceptEndpointGroupAssociation;
import com.pulumi.gcp.networksecurity.InterceptEndpointGroupAssociationArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 producerNetwork = new Network("producerNetwork", NetworkArgs.builder()
            .name("example-prod-network")
            .autoCreateSubnetworks(false)
            .build());

        var consumerNetwork = new Network("consumerNetwork", NetworkArgs.builder()
            .name("example-cons-network")
            .autoCreateSubnetworks(false)
            .build());

        var deploymentGroup = new InterceptDeploymentGroup("deploymentGroup", InterceptDeploymentGroupArgs.builder()
            .interceptDeploymentGroupId("example-dg")
            .location("global")
            .network(producerNetwork.id())
            .build());

        var endpointGroup = new InterceptEndpointGroup("endpointGroup", InterceptEndpointGroupArgs.builder()
            .interceptEndpointGroupId("example-eg")
            .location("global")
            .interceptDeploymentGroup(deploymentGroup.id())
            .build());

        var default_ = new InterceptEndpointGroupAssociation("default", InterceptEndpointGroupAssociationArgs.builder()
            .interceptEndpointGroupAssociationId("example-ega")
            .location("global")
            .network(consumerNetwork.id())
            .interceptEndpointGroup(endpointGroup.id())
            .labels(Map.of("foo", "bar"))
            .build());

    }
}
resources:
  producerNetwork:
    type: gcp:compute:Network
    name: producer_network
    properties:
      name: example-prod-network
      autoCreateSubnetworks: false
  consumerNetwork:
    type: gcp:compute:Network
    name: consumer_network
    properties:
      name: example-cons-network
      autoCreateSubnetworks: false
  deploymentGroup:
    type: gcp:networksecurity:InterceptDeploymentGroup
    name: deployment_group
    properties:
      interceptDeploymentGroupId: example-dg
      location: global
      network: ${producerNetwork.id}
  endpointGroup:
    type: gcp:networksecurity:InterceptEndpointGroup
    name: endpoint_group
    properties:
      interceptEndpointGroupId: example-eg
      location: global
      interceptDeploymentGroup: ${deploymentGroup.id}
  default:
    type: gcp:networksecurity:InterceptEndpointGroupAssociation
    properties:
      interceptEndpointGroupAssociationId: example-ega
      location: global
      network: ${consumerNetwork.id}
      interceptEndpointGroup: ${endpointGroup.id}
      labels:
        foo: bar

Import

InterceptEndpointGroupAssociation can be imported using any of these accepted formats:

  • projects/{{project}}/locations/{{location}}/interceptEndpointGroupAssociations/{{intercept_endpoint_group_association_id}}
  • {{project}}/{{location}}/{{intercept_endpoint_group_association_id}}
  • {{location}}/{{intercept_endpoint_group_association_id}}

When using the pulumi import command, InterceptEndpointGroupAssociation can be imported using one of the formats above. For example:

$ pulumi import gcp:networksecurity/interceptEndpointGroupAssociation:InterceptEndpointGroupAssociation default projects/{{project}}/locations/{{location}}/interceptEndpointGroupAssociations/{{intercept_endpoint_group_association_id}}
$ pulumi import gcp:networksecurity/interceptEndpointGroupAssociation:InterceptEndpointGroupAssociation default {{project}}/{{location}}/{{intercept_endpoint_group_association_id}}
$ pulumi import gcp:networksecurity/interceptEndpointGroupAssociation:InterceptEndpointGroupAssociation default {{location}}/{{intercept_endpoint_group_association_id}}

Constructors

InterceptEndpointGroupAssociationNetworksecurity(String name, {InterceptEndpointGroupAssociationArgs? args, CustomResourceOptions? options})
Creates a new InterceptEndpointGroupAssociationNetworksecurity. name The Pulumi resource name. args Arguments used to configure this InterceptEndpointGroupAssociationNetworksecurity. The set of arguments for InterceptEndpointGroupAssociation. options Resource options controlling this resource's behavior.
InterceptEndpointGroupAssociationNetworksecurity.reference(String urn)
Creates a typed reference to an existing InterceptEndpointGroupAssociationNetworksecurity resource.

Properties

childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
createTime ↔ Output<String>
The timestamp when the resource was created. See https://google.aip.dev/148#timestamps.
latefinal
deletionPolicy ↔ Output<String>
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
latefinal
effectiveLabels ↔ Output<Map<String, String>>
All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
interceptEndpointGroup ↔ Output<String>
The endpoint group that this association is connected to, for example: projects/123456789/locations/global/interceptEndpointGroups/my-eg. See https://google.aip.dev/124.
latefinal
interceptEndpointGroupAssociationId ↔ Output<String?>
The ID to use for the new association, which will become the final component of the endpoint group's resource name. If not provided, the server will generate a unique ID.
latefinal
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
labels ↔ Output<Map<String, String>?>
Labels are key/value pairs that help to organize and filter resources. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field effectiveLabels for all of the labels present on the resource.
latefinal
location ↔ Output<String>
The cloud location of the association, currently restricted to global.
latefinal
locations ↔ Output<List<InterceptEndpointGroupAssociationLocation>>
The list of locations where the association is configured. This information is retrieved from the linked endpoint group. Structure is documented below.
latefinal
locationsDetails ↔ Output<List<InterceptEndpointGroupAssociationLocationsDetail>>
(Deprecated) The list of locations where the association is present. This information is retrieved from the linked endpoint group, and not configured as part of the association itself. Structure is documented below.
latefinal
name ↔ Output<String>
The resource name of this endpoint group association, for example: projects/123456789/locations/global/interceptEndpointGroupAssociations/my-eg-association. See https://google.aip.dev/122 for more details.
latefinal
network ↔ Output<String>
The VPC network that is associated. for example: projects/123456789/global/networks/my-network. See https://google.aip.dev/124.
latefinal
project ↔ Output<String>
The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
latefinal
pulumiLabels ↔ Output<Map<String, String>>
The combination of labels configured directly on the resource and default labels configured on the provider.
latefinal
reconciling ↔ Output<bool>
The current state of the resource does not match the user's intended state, and the system is working to reconcile them. This part of the normal operation (e.g. adding a new location to the target deployment group). See https://google.aip.dev/128.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
state ↔ Output<String>
(Output) The current state of the association in this location. Possible values: STATE_UNSPECIFIED ACTIVE OUT_OF_SYNC
latefinal
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
updateTime ↔ Output<String>
The timestamp when the resource was most recently updated. See https://google.aip.dev/148#timestamps.
latefinal
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {InterceptEndpointGroupAssociationState? state, CustomResourceOptions? options}) → InterceptEndpointGroupAssociationNetworksecurity
Gets an existing InterceptEndpointGroupAssociationNetworksecurity resource's state with the given name and id.