Please wait. This can take some minutes ...
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.
com.pulumi.gcp.compute.kotlin.ServiceAttachmentArgs.kt Maven / Gradle / Ivy
@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.ServiceAttachmentArgs.builder
import com.pulumi.gcp.compute.kotlin.inputs.ServiceAttachmentConsumerAcceptListArgs
import com.pulumi.gcp.compute.kotlin.inputs.ServiceAttachmentConsumerAcceptListArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName
/**
* Represents a ServiceAttachment resource.
* To get more information about ServiceAttachment, see:
* * [API documentation](https://cloud.google.com/compute/docs/reference/beta/serviceAttachments)
* * How-to Guides
* * [Configuring Private Service Connect to access services](https://cloud.google.com/vpc/docs/configure-private-service-connect-services)
* ## Example Usage
* ### Service Attachment Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const producerServiceHealthCheck = new gcp.compute.HealthCheck("producer_service_health_check", {
* name: "producer-service-health-check",
* checkIntervalSec: 1,
* timeoutSec: 1,
* tcpHealthCheck: {
* port: 80,
* },
* });
* const producerServiceBackend = new gcp.compute.RegionBackendService("producer_service_backend", {
* name: "producer-service",
* region: "us-west2",
* healthChecks: producerServiceHealthCheck.id,
* });
* const pscIlbNetwork = new gcp.compute.Network("psc_ilb_network", {
* name: "psc-ilb-network",
* autoCreateSubnetworks: false,
* });
* const pscIlbProducerSubnetwork = new gcp.compute.Subnetwork("psc_ilb_producer_subnetwork", {
* name: "psc-ilb-producer-subnetwork",
* region: "us-west2",
* network: pscIlbNetwork.id,
* ipCidrRange: "10.0.0.0/16",
* });
* const pscIlbTargetService = new gcp.compute.ForwardingRule("psc_ilb_target_service", {
* name: "producer-forwarding-rule",
* region: "us-west2",
* loadBalancingScheme: "INTERNAL",
* backendService: producerServiceBackend.id,
* allPorts: true,
* network: pscIlbNetwork.name,
* subnetwork: pscIlbProducerSubnetwork.name,
* });
* const pscIlbNat = new gcp.compute.Subnetwork("psc_ilb_nat", {
* name: "psc-ilb-nat",
* region: "us-west2",
* network: pscIlbNetwork.id,
* purpose: "PRIVATE_SERVICE_CONNECT",
* ipCidrRange: "10.1.0.0/16",
* });
* const pscIlbServiceAttachment = new gcp.compute.ServiceAttachment("psc_ilb_service_attachment", {
* name: "my-psc-ilb",
* region: "us-west2",
* description: "A service attachment configured with Terraform",
* domainNames: ["gcp.tfacc.hashicorptest.com."],
* enableProxyProtocol: true,
* connectionPreference: "ACCEPT_AUTOMATIC",
* natSubnets: [pscIlbNat.id],
* targetService: pscIlbTargetService.id,
* });
* const pscIlbConsumerAddress = new gcp.compute.Address("psc_ilb_consumer_address", {
* name: "psc-ilb-consumer-address",
* region: "us-west2",
* subnetwork: "default",
* addressType: "INTERNAL",
* });
* const pscIlbConsumer = new gcp.compute.ForwardingRule("psc_ilb_consumer", {
* name: "psc-ilb-consumer-forwarding-rule",
* region: "us-west2",
* target: pscIlbServiceAttachment.id,
* loadBalancingScheme: "",
* network: "default",
* ipAddress: pscIlbConsumerAddress.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* producer_service_health_check = gcp.compute.HealthCheck("producer_service_health_check",
* name="producer-service-health-check",
* check_interval_sec=1,
* timeout_sec=1,
* tcp_health_check={
* "port": 80,
* })
* producer_service_backend = gcp.compute.RegionBackendService("producer_service_backend",
* name="producer-service",
* region="us-west2",
* health_checks=producer_service_health_check.id)
* psc_ilb_network = gcp.compute.Network("psc_ilb_network",
* name="psc-ilb-network",
* auto_create_subnetworks=False)
* psc_ilb_producer_subnetwork = gcp.compute.Subnetwork("psc_ilb_producer_subnetwork",
* name="psc-ilb-producer-subnetwork",
* region="us-west2",
* network=psc_ilb_network.id,
* ip_cidr_range="10.0.0.0/16")
* psc_ilb_target_service = gcp.compute.ForwardingRule("psc_ilb_target_service",
* name="producer-forwarding-rule",
* region="us-west2",
* load_balancing_scheme="INTERNAL",
* backend_service=producer_service_backend.id,
* all_ports=True,
* network=psc_ilb_network.name,
* subnetwork=psc_ilb_producer_subnetwork.name)
* psc_ilb_nat = gcp.compute.Subnetwork("psc_ilb_nat",
* name="psc-ilb-nat",
* region="us-west2",
* network=psc_ilb_network.id,
* purpose="PRIVATE_SERVICE_CONNECT",
* ip_cidr_range="10.1.0.0/16")
* psc_ilb_service_attachment = gcp.compute.ServiceAttachment("psc_ilb_service_attachment",
* name="my-psc-ilb",
* region="us-west2",
* description="A service attachment configured with Terraform",
* domain_names=["gcp.tfacc.hashicorptest.com."],
* enable_proxy_protocol=True,
* connection_preference="ACCEPT_AUTOMATIC",
* nat_subnets=[psc_ilb_nat.id],
* target_service=psc_ilb_target_service.id)
* psc_ilb_consumer_address = gcp.compute.Address("psc_ilb_consumer_address",
* name="psc-ilb-consumer-address",
* region="us-west2",
* subnetwork="default",
* address_type="INTERNAL")
* psc_ilb_consumer = gcp.compute.ForwardingRule("psc_ilb_consumer",
* name="psc-ilb-consumer-forwarding-rule",
* region="us-west2",
* target=psc_ilb_service_attachment.id,
* load_balancing_scheme="",
* network="default",
* ip_address=psc_ilb_consumer_address.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var producerServiceHealthCheck = new Gcp.Compute.HealthCheck("producer_service_health_check", new()
* {
* Name = "producer-service-health-check",
* CheckIntervalSec = 1,
* TimeoutSec = 1,
* TcpHealthCheck = new Gcp.Compute.Inputs.HealthCheckTcpHealthCheckArgs
* {
* Port = 80,
* },
* });
* var producerServiceBackend = new Gcp.Compute.RegionBackendService("producer_service_backend", new()
* {
* Name = "producer-service",
* Region = "us-west2",
* HealthChecks = producerServiceHealthCheck.Id,
* });
* var pscIlbNetwork = new Gcp.Compute.Network("psc_ilb_network", new()
* {
* Name = "psc-ilb-network",
* AutoCreateSubnetworks = false,
* });
* var pscIlbProducerSubnetwork = new Gcp.Compute.Subnetwork("psc_ilb_producer_subnetwork", new()
* {
* Name = "psc-ilb-producer-subnetwork",
* Region = "us-west2",
* Network = pscIlbNetwork.Id,
* IpCidrRange = "10.0.0.0/16",
* });
* var pscIlbTargetService = new Gcp.Compute.ForwardingRule("psc_ilb_target_service", new()
* {
* Name = "producer-forwarding-rule",
* Region = "us-west2",
* LoadBalancingScheme = "INTERNAL",
* BackendService = producerServiceBackend.Id,
* AllPorts = true,
* Network = pscIlbNetwork.Name,
* Subnetwork = pscIlbProducerSubnetwork.Name,
* });
* var pscIlbNat = new Gcp.Compute.Subnetwork("psc_ilb_nat", new()
* {
* Name = "psc-ilb-nat",
* Region = "us-west2",
* Network = pscIlbNetwork.Id,
* Purpose = "PRIVATE_SERVICE_CONNECT",
* IpCidrRange = "10.1.0.0/16",
* });
* var pscIlbServiceAttachment = new Gcp.Compute.ServiceAttachment("psc_ilb_service_attachment", new()
* {
* Name = "my-psc-ilb",
* Region = "us-west2",
* Description = "A service attachment configured with Terraform",
* DomainNames = new[]
* {
* "gcp.tfacc.hashicorptest.com.",
* },
* EnableProxyProtocol = true,
* ConnectionPreference = "ACCEPT_AUTOMATIC",
* NatSubnets = new[]
* {
* pscIlbNat.Id,
* },
* TargetService = pscIlbTargetService.Id,
* });
* var pscIlbConsumerAddress = new Gcp.Compute.Address("psc_ilb_consumer_address", new()
* {
* Name = "psc-ilb-consumer-address",
* Region = "us-west2",
* Subnetwork = "default",
* AddressType = "INTERNAL",
* });
* var pscIlbConsumer = new Gcp.Compute.ForwardingRule("psc_ilb_consumer", new()
* {
* Name = "psc-ilb-consumer-forwarding-rule",
* Region = "us-west2",
* Target = pscIlbServiceAttachment.Id,
* LoadBalancingScheme = "",
* Network = "default",
* IpAddress = pscIlbConsumerAddress.Id,
* });
* });
* ```
* ```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 {
* producerServiceHealthCheck, err := compute.NewHealthCheck(ctx, "producer_service_health_check", &compute.HealthCheckArgs{
* Name: pulumi.String("producer-service-health-check"),
* CheckIntervalSec: pulumi.Int(1),
* TimeoutSec: pulumi.Int(1),
* TcpHealthCheck: &compute.HealthCheckTcpHealthCheckArgs{
* Port: pulumi.Int(80),
* },
* })
* if err != nil {
* return err
* }
* producerServiceBackend, err := compute.NewRegionBackendService(ctx, "producer_service_backend", &compute.RegionBackendServiceArgs{
* Name: pulumi.String("producer-service"),
* Region: pulumi.String("us-west2"),
* HealthChecks: producerServiceHealthCheck.ID(),
* })
* if err != nil {
* return err
* }
* pscIlbNetwork, err := compute.NewNetwork(ctx, "psc_ilb_network", &compute.NetworkArgs{
* Name: pulumi.String("psc-ilb-network"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* pscIlbProducerSubnetwork, err := compute.NewSubnetwork(ctx, "psc_ilb_producer_subnetwork", &compute.SubnetworkArgs{
* Name: pulumi.String("psc-ilb-producer-subnetwork"),
* Region: pulumi.String("us-west2"),
* Network: pscIlbNetwork.ID(),
* IpCidrRange: pulumi.String("10.0.0.0/16"),
* })
* if err != nil {
* return err
* }
* pscIlbTargetService, err := compute.NewForwardingRule(ctx, "psc_ilb_target_service", &compute.ForwardingRuleArgs{
* Name: pulumi.String("producer-forwarding-rule"),
* Region: pulumi.String("us-west2"),
* LoadBalancingScheme: pulumi.String("INTERNAL"),
* BackendService: producerServiceBackend.ID(),
* AllPorts: pulumi.Bool(true),
* Network: pscIlbNetwork.Name,
* Subnetwork: pscIlbProducerSubnetwork.Name,
* })
* if err != nil {
* return err
* }
* pscIlbNat, err := compute.NewSubnetwork(ctx, "psc_ilb_nat", &compute.SubnetworkArgs{
* Name: pulumi.String("psc-ilb-nat"),
* Region: pulumi.String("us-west2"),
* Network: pscIlbNetwork.ID(),
* Purpose: pulumi.String("PRIVATE_SERVICE_CONNECT"),
* IpCidrRange: pulumi.String("10.1.0.0/16"),
* })
* if err != nil {
* return err
* }
* pscIlbServiceAttachment, err := compute.NewServiceAttachment(ctx, "psc_ilb_service_attachment", &compute.ServiceAttachmentArgs{
* Name: pulumi.String("my-psc-ilb"),
* Region: pulumi.String("us-west2"),
* Description: pulumi.String("A service attachment configured with Terraform"),
* DomainNames: pulumi.StringArray{
* pulumi.String("gcp.tfacc.hashicorptest.com."),
* },
* EnableProxyProtocol: pulumi.Bool(true),
* ConnectionPreference: pulumi.String("ACCEPT_AUTOMATIC"),
* NatSubnets: pulumi.StringArray{
* pscIlbNat.ID(),
* },
* TargetService: pscIlbTargetService.ID(),
* })
* if err != nil {
* return err
* }
* pscIlbConsumerAddress, err := compute.NewAddress(ctx, "psc_ilb_consumer_address", &compute.AddressArgs{
* Name: pulumi.String("psc-ilb-consumer-address"),
* Region: pulumi.String("us-west2"),
* Subnetwork: pulumi.String("default"),
* AddressType: pulumi.String("INTERNAL"),
* })
* if err != nil {
* return err
* }
* _, err = compute.NewForwardingRule(ctx, "psc_ilb_consumer", &compute.ForwardingRuleArgs{
* Name: pulumi.String("psc-ilb-consumer-forwarding-rule"),
* Region: pulumi.String("us-west2"),
* Target: pscIlbServiceAttachment.ID(),
* LoadBalancingScheme: pulumi.String(""),
* Network: pulumi.String("default"),
* IpAddress: pscIlbConsumerAddress.ID(),
* })
* 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.HealthCheck;
* import com.pulumi.gcp.compute.HealthCheckArgs;
* import com.pulumi.gcp.compute.inputs.HealthCheckTcpHealthCheckArgs;
* import com.pulumi.gcp.compute.RegionBackendService;
* import com.pulumi.gcp.compute.RegionBackendServiceArgs;
* import com.pulumi.gcp.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.gcp.compute.ForwardingRule;
* import com.pulumi.gcp.compute.ForwardingRuleArgs;
* import com.pulumi.gcp.compute.ServiceAttachment;
* import com.pulumi.gcp.compute.ServiceAttachmentArgs;
* import com.pulumi.gcp.compute.Address;
* import com.pulumi.gcp.compute.AddressArgs;
* 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 producerServiceHealthCheck = new HealthCheck("producerServiceHealthCheck", HealthCheckArgs.builder()
* .name("producer-service-health-check")
* .checkIntervalSec(1)
* .timeoutSec(1)
* .tcpHealthCheck(HealthCheckTcpHealthCheckArgs.builder()
* .port("80")
* .build())
* .build());
* var producerServiceBackend = new RegionBackendService("producerServiceBackend", RegionBackendServiceArgs.builder()
* .name("producer-service")
* .region("us-west2")
* .healthChecks(producerServiceHealthCheck.id())
* .build());
* var pscIlbNetwork = new Network("pscIlbNetwork", NetworkArgs.builder()
* .name("psc-ilb-network")
* .autoCreateSubnetworks(false)
* .build());
* var pscIlbProducerSubnetwork = new Subnetwork("pscIlbProducerSubnetwork", SubnetworkArgs.builder()
* .name("psc-ilb-producer-subnetwork")
* .region("us-west2")
* .network(pscIlbNetwork.id())
* .ipCidrRange("10.0.0.0/16")
* .build());
* var pscIlbTargetService = new ForwardingRule("pscIlbTargetService", ForwardingRuleArgs.builder()
* .name("producer-forwarding-rule")
* .region("us-west2")
* .loadBalancingScheme("INTERNAL")
* .backendService(producerServiceBackend.id())
* .allPorts(true)
* .network(pscIlbNetwork.name())
* .subnetwork(pscIlbProducerSubnetwork.name())
* .build());
* var pscIlbNat = new Subnetwork("pscIlbNat", SubnetworkArgs.builder()
* .name("psc-ilb-nat")
* .region("us-west2")
* .network(pscIlbNetwork.id())
* .purpose("PRIVATE_SERVICE_CONNECT")
* .ipCidrRange("10.1.0.0/16")
* .build());
* var pscIlbServiceAttachment = new ServiceAttachment("pscIlbServiceAttachment", ServiceAttachmentArgs.builder()
* .name("my-psc-ilb")
* .region("us-west2")
* .description("A service attachment configured with Terraform")
* .domainNames("gcp.tfacc.hashicorptest.com.")
* .enableProxyProtocol(true)
* .connectionPreference("ACCEPT_AUTOMATIC")
* .natSubnets(pscIlbNat.id())
* .targetService(pscIlbTargetService.id())
* .build());
* var pscIlbConsumerAddress = new Address("pscIlbConsumerAddress", AddressArgs.builder()
* .name("psc-ilb-consumer-address")
* .region("us-west2")
* .subnetwork("default")
* .addressType("INTERNAL")
* .build());
* var pscIlbConsumer = new ForwardingRule("pscIlbConsumer", ForwardingRuleArgs.builder()
* .name("psc-ilb-consumer-forwarding-rule")
* .region("us-west2")
* .target(pscIlbServiceAttachment.id())
* .loadBalancingScheme("")
* .network("default")
* .ipAddress(pscIlbConsumerAddress.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* pscIlbServiceAttachment:
* type: gcp:compute:ServiceAttachment
* name: psc_ilb_service_attachment
* properties:
* name: my-psc-ilb
* region: us-west2
* description: A service attachment configured with Terraform
* domainNames:
* - gcp.tfacc.hashicorptest.com.
* enableProxyProtocol: true
* connectionPreference: ACCEPT_AUTOMATIC
* natSubnets:
* - ${pscIlbNat.id}
* targetService: ${pscIlbTargetService.id}
* pscIlbConsumerAddress:
* type: gcp:compute:Address
* name: psc_ilb_consumer_address
* properties:
* name: psc-ilb-consumer-address
* region: us-west2
* subnetwork: default
* addressType: INTERNAL
* pscIlbConsumer:
* type: gcp:compute:ForwardingRule
* name: psc_ilb_consumer
* properties:
* name: psc-ilb-consumer-forwarding-rule
* region: us-west2
* target: ${pscIlbServiceAttachment.id}
* loadBalancingScheme:
* network: default
* ipAddress: ${pscIlbConsumerAddress.id}
* pscIlbTargetService:
* type: gcp:compute:ForwardingRule
* name: psc_ilb_target_service
* properties:
* name: producer-forwarding-rule
* region: us-west2
* loadBalancingScheme: INTERNAL
* backendService: ${producerServiceBackend.id}
* allPorts: true
* network: ${pscIlbNetwork.name}
* subnetwork: ${pscIlbProducerSubnetwork.name}
* producerServiceBackend:
* type: gcp:compute:RegionBackendService
* name: producer_service_backend
* properties:
* name: producer-service
* region: us-west2
* healthChecks: ${producerServiceHealthCheck.id}
* producerServiceHealthCheck:
* type: gcp:compute:HealthCheck
* name: producer_service_health_check
* properties:
* name: producer-service-health-check
* checkIntervalSec: 1
* timeoutSec: 1
* tcpHealthCheck:
* port: '80'
* pscIlbNetwork:
* type: gcp:compute:Network
* name: psc_ilb_network
* properties:
* name: psc-ilb-network
* autoCreateSubnetworks: false
* pscIlbProducerSubnetwork:
* type: gcp:compute:Subnetwork
* name: psc_ilb_producer_subnetwork
* properties:
* name: psc-ilb-producer-subnetwork
* region: us-west2
* network: ${pscIlbNetwork.id}
* ipCidrRange: 10.0.0.0/16
* pscIlbNat:
* type: gcp:compute:Subnetwork
* name: psc_ilb_nat
* properties:
* name: psc-ilb-nat
* region: us-west2
* network: ${pscIlbNetwork.id}
* purpose: PRIVATE_SERVICE_CONNECT
* ipCidrRange: 10.1.0.0/16
* ```
*
* ### Service Attachment Explicit Projects
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const producerServiceHealthCheck = new gcp.compute.HealthCheck("producer_service_health_check", {
* name: "producer-service-health-check",
* checkIntervalSec: 1,
* timeoutSec: 1,
* tcpHealthCheck: {
* port: 80,
* },
* });
* const producerServiceBackend = new gcp.compute.RegionBackendService("producer_service_backend", {
* name: "producer-service",
* region: "us-west2",
* healthChecks: producerServiceHealthCheck.id,
* });
* const pscIlbNetwork = new gcp.compute.Network("psc_ilb_network", {
* name: "psc-ilb-network",
* autoCreateSubnetworks: false,
* });
* const pscIlbProducerSubnetwork = new gcp.compute.Subnetwork("psc_ilb_producer_subnetwork", {
* name: "psc-ilb-producer-subnetwork",
* region: "us-west2",
* network: pscIlbNetwork.id,
* ipCidrRange: "10.0.0.0/16",
* });
* const pscIlbTargetService = new gcp.compute.ForwardingRule("psc_ilb_target_service", {
* name: "producer-forwarding-rule",
* region: "us-west2",
* loadBalancingScheme: "INTERNAL",
* backendService: producerServiceBackend.id,
* allPorts: true,
* network: pscIlbNetwork.name,
* subnetwork: pscIlbProducerSubnetwork.name,
* });
* const pscIlbNat = new gcp.compute.Subnetwork("psc_ilb_nat", {
* name: "psc-ilb-nat",
* region: "us-west2",
* network: pscIlbNetwork.id,
* purpose: "PRIVATE_SERVICE_CONNECT",
* ipCidrRange: "10.1.0.0/16",
* });
* const pscIlbServiceAttachment = new gcp.compute.ServiceAttachment("psc_ilb_service_attachment", {
* name: "my-psc-ilb",
* region: "us-west2",
* description: "A service attachment configured with Terraform",
* domainNames: ["gcp.tfacc.hashicorptest.com."],
* enableProxyProtocol: true,
* connectionPreference: "ACCEPT_MANUAL",
* natSubnets: [pscIlbNat.id],
* targetService: pscIlbTargetService.id,
* consumerRejectLists: [
* "673497134629",
* "482878270665",
* ],
* consumerAcceptLists: [{
* projectIdOrNum: "658859330310",
* connectionLimit: 4,
* }],
* });
* const pscIlbConsumerAddress = new gcp.compute.Address("psc_ilb_consumer_address", {
* name: "psc-ilb-consumer-address",
* region: "us-west2",
* subnetwork: "default",
* addressType: "INTERNAL",
* });
* const pscIlbConsumer = new gcp.compute.ForwardingRule("psc_ilb_consumer", {
* name: "psc-ilb-consumer-forwarding-rule",
* region: "us-west2",
* target: pscIlbServiceAttachment.id,
* loadBalancingScheme: "",
* network: "default",
* ipAddress: pscIlbConsumerAddress.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* producer_service_health_check = gcp.compute.HealthCheck("producer_service_health_check",
* name="producer-service-health-check",
* check_interval_sec=1,
* timeout_sec=1,
* tcp_health_check={
* "port": 80,
* })
* producer_service_backend = gcp.compute.RegionBackendService("producer_service_backend",
* name="producer-service",
* region="us-west2",
* health_checks=producer_service_health_check.id)
* psc_ilb_network = gcp.compute.Network("psc_ilb_network",
* name="psc-ilb-network",
* auto_create_subnetworks=False)
* psc_ilb_producer_subnetwork = gcp.compute.Subnetwork("psc_ilb_producer_subnetwork",
* name="psc-ilb-producer-subnetwork",
* region="us-west2",
* network=psc_ilb_network.id,
* ip_cidr_range="10.0.0.0/16")
* psc_ilb_target_service = gcp.compute.ForwardingRule("psc_ilb_target_service",
* name="producer-forwarding-rule",
* region="us-west2",
* load_balancing_scheme="INTERNAL",
* backend_service=producer_service_backend.id,
* all_ports=True,
* network=psc_ilb_network.name,
* subnetwork=psc_ilb_producer_subnetwork.name)
* psc_ilb_nat = gcp.compute.Subnetwork("psc_ilb_nat",
* name="psc-ilb-nat",
* region="us-west2",
* network=psc_ilb_network.id,
* purpose="PRIVATE_SERVICE_CONNECT",
* ip_cidr_range="10.1.0.0/16")
* psc_ilb_service_attachment = gcp.compute.ServiceAttachment("psc_ilb_service_attachment",
* name="my-psc-ilb",
* region="us-west2",
* description="A service attachment configured with Terraform",
* domain_names=["gcp.tfacc.hashicorptest.com."],
* enable_proxy_protocol=True,
* connection_preference="ACCEPT_MANUAL",
* nat_subnets=[psc_ilb_nat.id],
* target_service=psc_ilb_target_service.id,
* consumer_reject_lists=[
* "673497134629",
* "482878270665",
* ],
* consumer_accept_lists=[{
* "project_id_or_num": "658859330310",
* "connection_limit": 4,
* }])
* psc_ilb_consumer_address = gcp.compute.Address("psc_ilb_consumer_address",
* name="psc-ilb-consumer-address",
* region="us-west2",
* subnetwork="default",
* address_type="INTERNAL")
* psc_ilb_consumer = gcp.compute.ForwardingRule("psc_ilb_consumer",
* name="psc-ilb-consumer-forwarding-rule",
* region="us-west2",
* target=psc_ilb_service_attachment.id,
* load_balancing_scheme="",
* network="default",
* ip_address=psc_ilb_consumer_address.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var producerServiceHealthCheck = new Gcp.Compute.HealthCheck("producer_service_health_check", new()
* {
* Name = "producer-service-health-check",
* CheckIntervalSec = 1,
* TimeoutSec = 1,
* TcpHealthCheck = new Gcp.Compute.Inputs.HealthCheckTcpHealthCheckArgs
* {
* Port = 80,
* },
* });
* var producerServiceBackend = new Gcp.Compute.RegionBackendService("producer_service_backend", new()
* {
* Name = "producer-service",
* Region = "us-west2",
* HealthChecks = producerServiceHealthCheck.Id,
* });
* var pscIlbNetwork = new Gcp.Compute.Network("psc_ilb_network", new()
* {
* Name = "psc-ilb-network",
* AutoCreateSubnetworks = false,
* });
* var pscIlbProducerSubnetwork = new Gcp.Compute.Subnetwork("psc_ilb_producer_subnetwork", new()
* {
* Name = "psc-ilb-producer-subnetwork",
* Region = "us-west2",
* Network = pscIlbNetwork.Id,
* IpCidrRange = "10.0.0.0/16",
* });
* var pscIlbTargetService = new Gcp.Compute.ForwardingRule("psc_ilb_target_service", new()
* {
* Name = "producer-forwarding-rule",
* Region = "us-west2",
* LoadBalancingScheme = "INTERNAL",
* BackendService = producerServiceBackend.Id,
* AllPorts = true,
* Network = pscIlbNetwork.Name,
* Subnetwork = pscIlbProducerSubnetwork.Name,
* });
* var pscIlbNat = new Gcp.Compute.Subnetwork("psc_ilb_nat", new()
* {
* Name = "psc-ilb-nat",
* Region = "us-west2",
* Network = pscIlbNetwork.Id,
* Purpose = "PRIVATE_SERVICE_CONNECT",
* IpCidrRange = "10.1.0.0/16",
* });
* var pscIlbServiceAttachment = new Gcp.Compute.ServiceAttachment("psc_ilb_service_attachment", new()
* {
* Name = "my-psc-ilb",
* Region = "us-west2",
* Description = "A service attachment configured with Terraform",
* DomainNames = new[]
* {
* "gcp.tfacc.hashicorptest.com.",
* },
* EnableProxyProtocol = true,
* ConnectionPreference = "ACCEPT_MANUAL",
* NatSubnets = new[]
* {
* pscIlbNat.Id,
* },
* TargetService = pscIlbTargetService.Id,
* ConsumerRejectLists = new[]
* {
* "673497134629",
* "482878270665",
* },
* ConsumerAcceptLists = new[]
* {
* new Gcp.Compute.Inputs.ServiceAttachmentConsumerAcceptListArgs
* {
* ProjectIdOrNum = "658859330310",
* ConnectionLimit = 4,
* },
* },
* });
* var pscIlbConsumerAddress = new Gcp.Compute.Address("psc_ilb_consumer_address", new()
* {
* Name = "psc-ilb-consumer-address",
* Region = "us-west2",
* Subnetwork = "default",
* AddressType = "INTERNAL",
* });
* var pscIlbConsumer = new Gcp.Compute.ForwardingRule("psc_ilb_consumer", new()
* {
* Name = "psc-ilb-consumer-forwarding-rule",
* Region = "us-west2",
* Target = pscIlbServiceAttachment.Id,
* LoadBalancingScheme = "",
* Network = "default",
* IpAddress = pscIlbConsumerAddress.Id,
* });
* });
* ```
* ```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 {
* producerServiceHealthCheck, err := compute.NewHealthCheck(ctx, "producer_service_health_check", &compute.HealthCheckArgs{
* Name: pulumi.String("producer-service-health-check"),
* CheckIntervalSec: pulumi.Int(1),
* TimeoutSec: pulumi.Int(1),
* TcpHealthCheck: &compute.HealthCheckTcpHealthCheckArgs{
* Port: pulumi.Int(80),
* },
* })
* if err != nil {
* return err
* }
* producerServiceBackend, err := compute.NewRegionBackendService(ctx, "producer_service_backend", &compute.RegionBackendServiceArgs{
* Name: pulumi.String("producer-service"),
* Region: pulumi.String("us-west2"),
* HealthChecks: producerServiceHealthCheck.ID(),
* })
* if err != nil {
* return err
* }
* pscIlbNetwork, err := compute.NewNetwork(ctx, "psc_ilb_network", &compute.NetworkArgs{
* Name: pulumi.String("psc-ilb-network"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* pscIlbProducerSubnetwork, err := compute.NewSubnetwork(ctx, "psc_ilb_producer_subnetwork", &compute.SubnetworkArgs{
* Name: pulumi.String("psc-ilb-producer-subnetwork"),
* Region: pulumi.String("us-west2"),
* Network: pscIlbNetwork.ID(),
* IpCidrRange: pulumi.String("10.0.0.0/16"),
* })
* if err != nil {
* return err
* }
* pscIlbTargetService, err := compute.NewForwardingRule(ctx, "psc_ilb_target_service", &compute.ForwardingRuleArgs{
* Name: pulumi.String("producer-forwarding-rule"),
* Region: pulumi.String("us-west2"),
* LoadBalancingScheme: pulumi.String("INTERNAL"),
* BackendService: producerServiceBackend.ID(),
* AllPorts: pulumi.Bool(true),
* Network: pscIlbNetwork.Name,
* Subnetwork: pscIlbProducerSubnetwork.Name,
* })
* if err != nil {
* return err
* }
* pscIlbNat, err := compute.NewSubnetwork(ctx, "psc_ilb_nat", &compute.SubnetworkArgs{
* Name: pulumi.String("psc-ilb-nat"),
* Region: pulumi.String("us-west2"),
* Network: pscIlbNetwork.ID(),
* Purpose: pulumi.String("PRIVATE_SERVICE_CONNECT"),
* IpCidrRange: pulumi.String("10.1.0.0/16"),
* })
* if err != nil {
* return err
* }
* pscIlbServiceAttachment, err := compute.NewServiceAttachment(ctx, "psc_ilb_service_attachment", &compute.ServiceAttachmentArgs{
* Name: pulumi.String("my-psc-ilb"),
* Region: pulumi.String("us-west2"),
* Description: pulumi.String("A service attachment configured with Terraform"),
* DomainNames: pulumi.StringArray{
* pulumi.String("gcp.tfacc.hashicorptest.com."),
* },
* EnableProxyProtocol: pulumi.Bool(true),
* ConnectionPreference: pulumi.String("ACCEPT_MANUAL"),
* NatSubnets: pulumi.StringArray{
* pscIlbNat.ID(),
* },
* TargetService: pscIlbTargetService.ID(),
* ConsumerRejectLists: pulumi.StringArray{
* pulumi.String("673497134629"),
* pulumi.String("482878270665"),
* },
* ConsumerAcceptLists: compute.ServiceAttachmentConsumerAcceptListArray{
* &compute.ServiceAttachmentConsumerAcceptListArgs{
* ProjectIdOrNum: pulumi.String("658859330310"),
* ConnectionLimit: pulumi.Int(4),
* },
* },
* })
* if err != nil {
* return err
* }
* pscIlbConsumerAddress, err := compute.NewAddress(ctx, "psc_ilb_consumer_address", &compute.AddressArgs{
* Name: pulumi.String("psc-ilb-consumer-address"),
* Region: pulumi.String("us-west2"),
* Subnetwork: pulumi.String("default"),
* AddressType: pulumi.String("INTERNAL"),
* })
* if err != nil {
* return err
* }
* _, err = compute.NewForwardingRule(ctx, "psc_ilb_consumer", &compute.ForwardingRuleArgs{
* Name: pulumi.String("psc-ilb-consumer-forwarding-rule"),
* Region: pulumi.String("us-west2"),
* Target: pscIlbServiceAttachment.ID(),
* LoadBalancingScheme: pulumi.String(""),
* Network: pulumi.String("default"),
* IpAddress: pscIlbConsumerAddress.ID(),
* })
* 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.HealthCheck;
* import com.pulumi.gcp.compute.HealthCheckArgs;
* import com.pulumi.gcp.compute.inputs.HealthCheckTcpHealthCheckArgs;
* import com.pulumi.gcp.compute.RegionBackendService;
* import com.pulumi.gcp.compute.RegionBackendServiceArgs;
* import com.pulumi.gcp.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.gcp.compute.ForwardingRule;
* import com.pulumi.gcp.compute.ForwardingRuleArgs;
* import com.pulumi.gcp.compute.ServiceAttachment;
* import com.pulumi.gcp.compute.ServiceAttachmentArgs;
* import com.pulumi.gcp.compute.inputs.ServiceAttachmentConsumerAcceptListArgs;
* import com.pulumi.gcp.compute.Address;
* import com.pulumi.gcp.compute.AddressArgs;
* 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 producerServiceHealthCheck = new HealthCheck("producerServiceHealthCheck", HealthCheckArgs.builder()
* .name("producer-service-health-check")
* .checkIntervalSec(1)
* .timeoutSec(1)
* .tcpHealthCheck(HealthCheckTcpHealthCheckArgs.builder()
* .port("80")
* .build())
* .build());
* var producerServiceBackend = new RegionBackendService("producerServiceBackend", RegionBackendServiceArgs.builder()
* .name("producer-service")
* .region("us-west2")
* .healthChecks(producerServiceHealthCheck.id())
* .build());
* var pscIlbNetwork = new Network("pscIlbNetwork", NetworkArgs.builder()
* .name("psc-ilb-network")
* .autoCreateSubnetworks(false)
* .build());
* var pscIlbProducerSubnetwork = new Subnetwork("pscIlbProducerSubnetwork", SubnetworkArgs.builder()
* .name("psc-ilb-producer-subnetwork")
* .region("us-west2")
* .network(pscIlbNetwork.id())
* .ipCidrRange("10.0.0.0/16")
* .build());
* var pscIlbTargetService = new ForwardingRule("pscIlbTargetService", ForwardingRuleArgs.builder()
* .name("producer-forwarding-rule")
* .region("us-west2")
* .loadBalancingScheme("INTERNAL")
* .backendService(producerServiceBackend.id())
* .allPorts(true)
* .network(pscIlbNetwork.name())
* .subnetwork(pscIlbProducerSubnetwork.name())
* .build());
* var pscIlbNat = new Subnetwork("pscIlbNat", SubnetworkArgs.builder()
* .name("psc-ilb-nat")
* .region("us-west2")
* .network(pscIlbNetwork.id())
* .purpose("PRIVATE_SERVICE_CONNECT")
* .ipCidrRange("10.1.0.0/16")
* .build());
* var pscIlbServiceAttachment = new ServiceAttachment("pscIlbServiceAttachment", ServiceAttachmentArgs.builder()
* .name("my-psc-ilb")
* .region("us-west2")
* .description("A service attachment configured with Terraform")
* .domainNames("gcp.tfacc.hashicorptest.com.")
* .enableProxyProtocol(true)
* .connectionPreference("ACCEPT_MANUAL")
* .natSubnets(pscIlbNat.id())
* .targetService(pscIlbTargetService.id())
* .consumerRejectLists(
* "673497134629",
* "482878270665")
* .consumerAcceptLists(ServiceAttachmentConsumerAcceptListArgs.builder()
* .projectIdOrNum("658859330310")
* .connectionLimit(4)
* .build())
* .build());
* var pscIlbConsumerAddress = new Address("pscIlbConsumerAddress", AddressArgs.builder()
* .name("psc-ilb-consumer-address")
* .region("us-west2")
* .subnetwork("default")
* .addressType("INTERNAL")
* .build());
* var pscIlbConsumer = new ForwardingRule("pscIlbConsumer", ForwardingRuleArgs.builder()
* .name("psc-ilb-consumer-forwarding-rule")
* .region("us-west2")
* .target(pscIlbServiceAttachment.id())
* .loadBalancingScheme("")
* .network("default")
* .ipAddress(pscIlbConsumerAddress.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* pscIlbServiceAttachment:
* type: gcp:compute:ServiceAttachment
* name: psc_ilb_service_attachment
* properties:
* name: my-psc-ilb
* region: us-west2
* description: A service attachment configured with Terraform
* domainNames:
* - gcp.tfacc.hashicorptest.com.
* enableProxyProtocol: true
* connectionPreference: ACCEPT_MANUAL
* natSubnets:
* - ${pscIlbNat.id}
* targetService: ${pscIlbTargetService.id}
* consumerRejectLists:
* - '673497134629'
* - '482878270665'
* consumerAcceptLists:
* - projectIdOrNum: '658859330310'
* connectionLimit: 4
* pscIlbConsumerAddress:
* type: gcp:compute:Address
* name: psc_ilb_consumer_address
* properties:
* name: psc-ilb-consumer-address
* region: us-west2
* subnetwork: default
* addressType: INTERNAL
* pscIlbConsumer:
* type: gcp:compute:ForwardingRule
* name: psc_ilb_consumer
* properties:
* name: psc-ilb-consumer-forwarding-rule
* region: us-west2
* target: ${pscIlbServiceAttachment.id}
* loadBalancingScheme:
* network: default
* ipAddress: ${pscIlbConsumerAddress.id}
* pscIlbTargetService:
* type: gcp:compute:ForwardingRule
* name: psc_ilb_target_service
* properties:
* name: producer-forwarding-rule
* region: us-west2
* loadBalancingScheme: INTERNAL
* backendService: ${producerServiceBackend.id}
* allPorts: true
* network: ${pscIlbNetwork.name}
* subnetwork: ${pscIlbProducerSubnetwork.name}
* producerServiceBackend:
* type: gcp:compute:RegionBackendService
* name: producer_service_backend
* properties:
* name: producer-service
* region: us-west2
* healthChecks: ${producerServiceHealthCheck.id}
* producerServiceHealthCheck:
* type: gcp:compute:HealthCheck
* name: producer_service_health_check
* properties:
* name: producer-service-health-check
* checkIntervalSec: 1
* timeoutSec: 1
* tcpHealthCheck:
* port: '80'
* pscIlbNetwork:
* type: gcp:compute:Network
* name: psc_ilb_network
* properties:
* name: psc-ilb-network
* autoCreateSubnetworks: false
* pscIlbProducerSubnetwork:
* type: gcp:compute:Subnetwork
* name: psc_ilb_producer_subnetwork
* properties:
* name: psc-ilb-producer-subnetwork
* region: us-west2
* network: ${pscIlbNetwork.id}
* ipCidrRange: 10.0.0.0/16
* pscIlbNat:
* type: gcp:compute:Subnetwork
* name: psc_ilb_nat
* properties:
* name: psc-ilb-nat
* region: us-west2
* network: ${pscIlbNetwork.id}
* purpose: PRIVATE_SERVICE_CONNECT
* ipCidrRange: 10.1.0.0/16
* ```
*
* ### Service Attachment Explicit Networks
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const pscIlbConsumerNetwork = new gcp.compute.Network("psc_ilb_consumer_network", {
* name: "psc-ilb-consumer-network",
* autoCreateSubnetworks: false,
* });
* const producerServiceHealthCheck = new gcp.compute.HealthCheck("producer_service_health_check", {
* name: "producer-service-health-check",
* checkIntervalSec: 1,
* timeoutSec: 1,
* tcpHealthCheck: {
* port: 80,
* },
* });
* const producerServiceBackend = new gcp.compute.RegionBackendService("producer_service_backend", {
* name: "producer-service",
* region: "us-west2",
* healthChecks: producerServiceHealthCheck.id,
* });
* const pscIlbNetwork = new gcp.compute.Network("psc_ilb_network", {
* name: "psc-ilb-network",
* autoCreateSubnetworks: false,
* });
* const pscIlbProducerSubnetwork = new gcp.compute.Subnetwork("psc_ilb_producer_subnetwork", {
* name: "psc-ilb-producer-subnetwork",
* region: "us-west2",
* network: pscIlbNetwork.id,
* ipCidrRange: "10.0.0.0/16",
* });
* const pscIlbTargetService = new gcp.compute.ForwardingRule("psc_ilb_target_service", {
* name: "producer-forwarding-rule",
* region: "us-west2",
* loadBalancingScheme: "INTERNAL",
* backendService: producerServiceBackend.id,
* allPorts: true,
* network: pscIlbNetwork.name,
* subnetwork: pscIlbProducerSubnetwork.name,
* });
* const pscIlbNat = new gcp.compute.Subnetwork("psc_ilb_nat", {
* name: "psc-ilb-nat",
* region: "us-west2",
* network: pscIlbNetwork.id,
* purpose: "PRIVATE_SERVICE_CONNECT",
* ipCidrRange: "10.1.0.0/16",
* });
* const pscIlbServiceAttachment = new gcp.compute.ServiceAttachment("psc_ilb_service_attachment", {
* name: "my-psc-ilb",
* region: "us-west2",
* description: "A service attachment configured with Terraform",
* enableProxyProtocol: false,
* connectionPreference: "ACCEPT_MANUAL",
* natSubnets: [pscIlbNat.id],
* targetService: pscIlbTargetService.id,
* consumerAcceptLists: [{
* networkUrl: pscIlbConsumerNetwork.selfLink,
* connectionLimit: 1,
* }],
* });
* const pscIlbConsumerSubnetwork = new gcp.compute.Subnetwork("psc_ilb_consumer_subnetwork", {
* name: "psc-ilb-consumer-network",
* ipCidrRange: "10.0.0.0/16",
* region: "us-west2",
* network: pscIlbConsumerNetwork.id,
* });
* const pscIlbConsumerAddress = new gcp.compute.Address("psc_ilb_consumer_address", {
* name: "psc-ilb-consumer-address",
* region: "us-west2",
* subnetwork: pscIlbConsumerSubnetwork.id,
* addressType: "INTERNAL",
* });
* const pscIlbConsumer = new gcp.compute.ForwardingRule("psc_ilb_consumer", {
* name: "psc-ilb-consumer-forwarding-rule",
* region: "us-west2",
* target: pscIlbServiceAttachment.id,
* loadBalancingScheme: "",
* network: pscIlbConsumerNetwork.id,
* subnetwork: pscIlbConsumerSubnetwork.id,
* ipAddress: pscIlbConsumerAddress.id,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* psc_ilb_consumer_network = gcp.compute.Network("psc_ilb_consumer_network",
* name="psc-ilb-consumer-network",
* auto_create_subnetworks=False)
* producer_service_health_check = gcp.compute.HealthCheck("producer_service_health_check",
* name="producer-service-health-check",
* check_interval_sec=1,
* timeout_sec=1,
* tcp_health_check={
* "port": 80,
* })
* producer_service_backend = gcp.compute.RegionBackendService("producer_service_backend",
* name="producer-service",
* region="us-west2",
* health_checks=producer_service_health_check.id)
* psc_ilb_network = gcp.compute.Network("psc_ilb_network",
* name="psc-ilb-network",
* auto_create_subnetworks=False)
* psc_ilb_producer_subnetwork = gcp.compute.Subnetwork("psc_ilb_producer_subnetwork",
* name="psc-ilb-producer-subnetwork",
* region="us-west2",
* network=psc_ilb_network.id,
* ip_cidr_range="10.0.0.0/16")
* psc_ilb_target_service = gcp.compute.ForwardingRule("psc_ilb_target_service",
* name="producer-forwarding-rule",
* region="us-west2",
* load_balancing_scheme="INTERNAL",
* backend_service=producer_service_backend.id,
* all_ports=True,
* network=psc_ilb_network.name,
* subnetwork=psc_ilb_producer_subnetwork.name)
* psc_ilb_nat = gcp.compute.Subnetwork("psc_ilb_nat",
* name="psc-ilb-nat",
* region="us-west2",
* network=psc_ilb_network.id,
* purpose="PRIVATE_SERVICE_CONNECT",
* ip_cidr_range="10.1.0.0/16")
* psc_ilb_service_attachment = gcp.compute.ServiceAttachment("psc_ilb_service_attachment",
* name="my-psc-ilb",
* region="us-west2",
* description="A service attachment configured with Terraform",
* enable_proxy_protocol=False,
* connection_preference="ACCEPT_MANUAL",
* nat_subnets=[psc_ilb_nat.id],
* target_service=psc_ilb_target_service.id,
* consumer_accept_lists=[{
* "network_url": psc_ilb_consumer_network.self_link,
* "connection_limit": 1,
* }])
* psc_ilb_consumer_subnetwork = gcp.compute.Subnetwork("psc_ilb_consumer_subnetwork",
* name="psc-ilb-consumer-network",
* ip_cidr_range="10.0.0.0/16",
* region="us-west2",
* network=psc_ilb_consumer_network.id)
* psc_ilb_consumer_address = gcp.compute.Address("psc_ilb_consumer_address",
* name="psc-ilb-consumer-address",
* region="us-west2",
* subnetwork=psc_ilb_consumer_subnetwork.id,
* address_type="INTERNAL")
* psc_ilb_consumer = gcp.compute.ForwardingRule("psc_ilb_consumer",
* name="psc-ilb-consumer-forwarding-rule",
* region="us-west2",
* target=psc_ilb_service_attachment.id,
* load_balancing_scheme="",
* network=psc_ilb_consumer_network.id,
* subnetwork=psc_ilb_consumer_subnetwork.id,
* ip_address=psc_ilb_consumer_address.id)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var pscIlbConsumerNetwork = new Gcp.Compute.Network("psc_ilb_consumer_network", new()
* {
* Name = "psc-ilb-consumer-network",
* AutoCreateSubnetworks = false,
* });
* var producerServiceHealthCheck = new Gcp.Compute.HealthCheck("producer_service_health_check", new()
* {
* Name = "producer-service-health-check",
* CheckIntervalSec = 1,
* TimeoutSec = 1,
* TcpHealthCheck = new Gcp.Compute.Inputs.HealthCheckTcpHealthCheckArgs
* {
* Port = 80,
* },
* });
* var producerServiceBackend = new Gcp.Compute.RegionBackendService("producer_service_backend", new()
* {
* Name = "producer-service",
* Region = "us-west2",
* HealthChecks = producerServiceHealthCheck.Id,
* });
* var pscIlbNetwork = new Gcp.Compute.Network("psc_ilb_network", new()
* {
* Name = "psc-ilb-network",
* AutoCreateSubnetworks = false,
* });
* var pscIlbProducerSubnetwork = new Gcp.Compute.Subnetwork("psc_ilb_producer_subnetwork", new()
* {
* Name = "psc-ilb-producer-subnetwork",
* Region = "us-west2",
* Network = pscIlbNetwork.Id,
* IpCidrRange = "10.0.0.0/16",
* });
* var pscIlbTargetService = new Gcp.Compute.ForwardingRule("psc_ilb_target_service", new()
* {
* Name = "producer-forwarding-rule",
* Region = "us-west2",
* LoadBalancingScheme = "INTERNAL",
* BackendService = producerServiceBackend.Id,
* AllPorts = true,
* Network = pscIlbNetwork.Name,
* Subnetwork = pscIlbProducerSubnetwork.Name,
* });
* var pscIlbNat = new Gcp.Compute.Subnetwork("psc_ilb_nat", new()
* {
* Name = "psc-ilb-nat",
* Region = "us-west2",
* Network = pscIlbNetwork.Id,
* Purpose = "PRIVATE_SERVICE_CONNECT",
* IpCidrRange = "10.1.0.0/16",
* });
* var pscIlbServiceAttachment = new Gcp.Compute.ServiceAttachment("psc_ilb_service_attachment", new()
* {
* Name = "my-psc-ilb",
* Region = "us-west2",
* Description = "A service attachment configured with Terraform",
* EnableProxyProtocol = false,
* ConnectionPreference = "ACCEPT_MANUAL",
* NatSubnets = new[]
* {
* pscIlbNat.Id,
* },
* TargetService = pscIlbTargetService.Id,
* ConsumerAcceptLists = new[]
* {
* new Gcp.Compute.Inputs.ServiceAttachmentConsumerAcceptListArgs
* {
* NetworkUrl = pscIlbConsumerNetwork.SelfLink,
* ConnectionLimit = 1,
* },
* },
* });
* var pscIlbConsumerSubnetwork = new Gcp.Compute.Subnetwork("psc_ilb_consumer_subnetwork", new()
* {
* Name = "psc-ilb-consumer-network",
* IpCidrRange = "10.0.0.0/16",
* Region = "us-west2",
* Network = pscIlbConsumerNetwork.Id,
* });
* var pscIlbConsumerAddress = new Gcp.Compute.Address("psc_ilb_consumer_address", new()
* {
* Name = "psc-ilb-consumer-address",
* Region = "us-west2",
* Subnetwork = pscIlbConsumerSubnetwork.Id,
* AddressType = "INTERNAL",
* });
* var pscIlbConsumer = new Gcp.Compute.ForwardingRule("psc_ilb_consumer", new()
* {
* Name = "psc-ilb-consumer-forwarding-rule",
* Region = "us-west2",
* Target = pscIlbServiceAttachment.Id,
* LoadBalancingScheme = "",
* Network = pscIlbConsumerNetwork.Id,
* Subnetwork = pscIlbConsumerSubnetwork.Id,
* IpAddress = pscIlbConsumerAddress.Id,
* });
* });
* ```
* ```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 {
* pscIlbConsumerNetwork, err := compute.NewNetwork(ctx, "psc_ilb_consumer_network", &compute.NetworkArgs{
* Name: pulumi.String("psc-ilb-consumer-network"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* producerServiceHealthCheck, err := compute.NewHealthCheck(ctx, "producer_service_health_check", &compute.HealthCheckArgs{
* Name: pulumi.String("producer-service-health-check"),
* CheckIntervalSec: pulumi.Int(1),
* TimeoutSec: pulumi.Int(1),
* TcpHealthCheck: &compute.HealthCheckTcpHealthCheckArgs{
* Port: pulumi.Int(80),
* },
* })
* if err != nil {
* return err
* }
* producerServiceBackend, err := compute.NewRegionBackendService(ctx, "producer_service_backend", &compute.RegionBackendServiceArgs{
* Name: pulumi.String("producer-service"),
* Region: pulumi.String("us-west2"),
* HealthChecks: producerServiceHealthCheck.ID(),
* })
* if err != nil {
* return err
* }
* pscIlbNetwork, err := compute.NewNetwork(ctx, "psc_ilb_network", &compute.NetworkArgs{
* Name: pulumi.String("psc-ilb-network"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* pscIlbProducerSubnetwork, err := compute.NewSubnetwork(ctx, "psc_ilb_producer_subnetwork", &compute.SubnetworkArgs{
* Name: pulumi.String("psc-ilb-producer-subnetwork"),
* Region: pulumi.String("us-west2"),
* Network: pscIlbNetwork.ID(),
* IpCidrRange: pulumi.String("10.0.0.0/16"),
* })
* if err != nil {
* return err
* }
* pscIlbTargetService, err := compute.NewForwardingRule(ctx, "psc_ilb_target_service", &compute.ForwardingRuleArgs{
* Name: pulumi.String("producer-forwarding-rule"),
* Region: pulumi.String("us-west2"),
* LoadBalancingScheme: pulumi.String("INTERNAL"),
* BackendService: producerServiceBackend.ID(),
* AllPorts: pulumi.Bool(true),
* Network: pscIlbNetwork.Name,
* Subnetwork: pscIlbProducerSubnetwork.Name,
* })
* if err != nil {
* return err
* }
* pscIlbNat, err := compute.NewSubnetwork(ctx, "psc_ilb_nat", &compute.SubnetworkArgs{
* Name: pulumi.String("psc-ilb-nat"),
* Region: pulumi.String("us-west2"),
* Network: pscIlbNetwork.ID(),
* Purpose: pulumi.String("PRIVATE_SERVICE_CONNECT"),
* IpCidrRange: pulumi.String("10.1.0.0/16"),
* })
* if err != nil {
* return err
* }
* pscIlbServiceAttachment, err := compute.NewServiceAttachment(ctx, "psc_ilb_service_attachment", &compute.ServiceAttachmentArgs{
* Name: pulumi.String("my-psc-ilb"),
* Region: pulumi.String("us-west2"),
* Description: pulumi.String("A service attachment configured with Terraform"),
* EnableProxyProtocol: pulumi.Bool(false),
* ConnectionPreference: pulumi.String("ACCEPT_MANUAL"),
* NatSubnets: pulumi.StringArray{
* pscIlbNat.ID(),
* },
* TargetService: pscIlbTargetService.ID(),
* ConsumerAcceptLists: compute.ServiceAttachmentConsumerAcceptListArray{
* &compute.ServiceAttachmentConsumerAcceptListArgs{
* NetworkUrl: pscIlbConsumerNetwork.SelfLink,
* ConnectionLimit: pulumi.Int(1),
* },
* },
* })
* if err != nil {
* return err
* }
* pscIlbConsumerSubnetwork, err := compute.NewSubnetwork(ctx, "psc_ilb_consumer_subnetwork", &compute.SubnetworkArgs{
* Name: pulumi.String("psc-ilb-consumer-network"),
* IpCidrRange: pulumi.String("10.0.0.0/16"),
* Region: pulumi.String("us-west2"),
* Network: pscIlbConsumerNetwork.ID(),
* })
* if err != nil {
* return err
* }
* pscIlbConsumerAddress, err := compute.NewAddress(ctx, "psc_ilb_consumer_address", &compute.AddressArgs{
* Name: pulumi.String("psc-ilb-consumer-address"),
* Region: pulumi.String("us-west2"),
* Subnetwork: pscIlbConsumerSubnetwork.ID(),
* AddressType: pulumi.String("INTERNAL"),
* })
* if err != nil {
* return err
* }
* _, err = compute.NewForwardingRule(ctx, "psc_ilb_consumer", &compute.ForwardingRuleArgs{
* Name: pulumi.String("psc-ilb-consumer-forwarding-rule"),
* Region: pulumi.String("us-west2"),
* Target: pscIlbServiceAttachment.ID(),
* LoadBalancingScheme: pulumi.String(""),
* Network: pscIlbConsumerNetwork.ID(),
* Subnetwork: pscIlbConsumerSubnetwork.ID(),
* IpAddress: pscIlbConsumerAddress.ID(),
* })
* 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.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.HealthCheck;
* import com.pulumi.gcp.compute.HealthCheckArgs;
* import com.pulumi.gcp.compute.inputs.HealthCheckTcpHealthCheckArgs;
* import com.pulumi.gcp.compute.RegionBackendService;
* import com.pulumi.gcp.compute.RegionBackendServiceArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.gcp.compute.ForwardingRule;
* import com.pulumi.gcp.compute.ForwardingRuleArgs;
* import com.pulumi.gcp.compute.ServiceAttachment;
* import com.pulumi.gcp.compute.ServiceAttachmentArgs;
* import com.pulumi.gcp.compute.inputs.ServiceAttachmentConsumerAcceptListArgs;
* import com.pulumi.gcp.compute.Address;
* import com.pulumi.gcp.compute.AddressArgs;
* 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 pscIlbConsumerNetwork = new Network("pscIlbConsumerNetwork", NetworkArgs.builder()
* .name("psc-ilb-consumer-network")
* .autoCreateSubnetworks(false)
* .build());
* var producerServiceHealthCheck = new HealthCheck("producerServiceHealthCheck", HealthCheckArgs.builder()
* .name("producer-service-health-check")
* .checkIntervalSec(1)
* .timeoutSec(1)
* .tcpHealthCheck(HealthCheckTcpHealthCheckArgs.builder()
* .port("80")
* .build())
* .build());
* var producerServiceBackend = new RegionBackendService("producerServiceBackend", RegionBackendServiceArgs.builder()
* .name("producer-service")
* .region("us-west2")
* .healthChecks(producerServiceHealthCheck.id())
* .build());
* var pscIlbNetwork = new Network("pscIlbNetwork", NetworkArgs.builder()
* .name("psc-ilb-network")
* .autoCreateSubnetworks(false)
* .build());
* var pscIlbProducerSubnetwork = new Subnetwork("pscIlbProducerSubnetwork", SubnetworkArgs.builder()
* .name("psc-ilb-producer-subnetwork")
* .region("us-west2")
* .network(pscIlbNetwork.id())
* .ipCidrRange("10.0.0.0/16")
* .build());
* var pscIlbTargetService = new ForwardingRule("pscIlbTargetService", ForwardingRuleArgs.builder()
* .name("producer-forwarding-rule")
* .region("us-west2")
* .loadBalancingScheme("INTERNAL")
* .backendService(producerServiceBackend.id())
* .allPorts(true)
* .network(pscIlbNetwork.name())
* .subnetwork(pscIlbProducerSubnetwork.name())
* .build());
* var pscIlbNat = new Subnetwork("pscIlbNat", SubnetworkArgs.builder()
* .name("psc-ilb-nat")
* .region("us-west2")
* .network(pscIlbNetwork.id())
* .purpose("PRIVATE_SERVICE_CONNECT")
* .ipCidrRange("10.1.0.0/16")
* .build());
* var pscIlbServiceAttachment = new ServiceAttachment("pscIlbServiceAttachment", ServiceAttachmentArgs.builder()
* .name("my-psc-ilb")
* .region("us-west2")
* .description("A service attachment configured with Terraform")
* .enableProxyProtocol(false)
* .connectionPreference("ACCEPT_MANUAL")
* .natSubnets(pscIlbNat.id())
* .targetService(pscIlbTargetService.id())
* .consumerAcceptLists(ServiceAttachmentConsumerAcceptListArgs.builder()
* .networkUrl(pscIlbConsumerNetwork.selfLink())
* .connectionLimit(1)
* .build())
* .build());
* var pscIlbConsumerSubnetwork = new Subnetwork("pscIlbConsumerSubnetwork", SubnetworkArgs.builder()
* .name("psc-ilb-consumer-network")
* .ipCidrRange("10.0.0.0/16")
* .region("us-west2")
* .network(pscIlbConsumerNetwork.id())
* .build());
* var pscIlbConsumerAddress = new Address("pscIlbConsumerAddress", AddressArgs.builder()
* .name("psc-ilb-consumer-address")
* .region("us-west2")
* .subnetwork(pscIlbConsumerSubnetwork.id())
* .addressType("INTERNAL")
* .build());
* var pscIlbConsumer = new ForwardingRule("pscIlbConsumer", ForwardingRuleArgs.builder()
* .name("psc-ilb-consumer-forwarding-rule")
* .region("us-west2")
* .target(pscIlbServiceAttachment.id())
* .loadBalancingScheme("")
* .network(pscIlbConsumerNetwork.id())
* .subnetwork(pscIlbConsumerSubnetwork.id())
* .ipAddress(pscIlbConsumerAddress.id())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* pscIlbServiceAttachment:
* type: gcp:compute:ServiceAttachment
* name: psc_ilb_service_attachment
* properties:
* name: my-psc-ilb
* region: us-west2
* description: A service attachment configured with Terraform
* enableProxyProtocol: false
* connectionPreference: ACCEPT_MANUAL
* natSubnets:
* - ${pscIlbNat.id}
* targetService: ${pscIlbTargetService.id}
* consumerAcceptLists:
* - networkUrl: ${pscIlbConsumerNetwork.selfLink}
* connectionLimit: 1
* pscIlbConsumerNetwork:
* type: gcp:compute:Network
* name: psc_ilb_consumer_network
* properties:
* name: psc-ilb-consumer-network
* autoCreateSubnetworks: false
* pscIlbConsumerSubnetwork:
* type: gcp:compute:Subnetwork
* name: psc_ilb_consumer_subnetwork
* properties:
* name: psc-ilb-consumer-network
* ipCidrRange: 10.0.0.0/16
* region: us-west2
* network: ${pscIlbConsumerNetwork.id}
* pscIlbConsumerAddress:
* type: gcp:compute:Address
* name: psc_ilb_consumer_address
* properties:
* name: psc-ilb-consumer-address
* region: us-west2
* subnetwork: ${pscIlbConsumerSubnetwork.id}
* addressType: INTERNAL
* pscIlbConsumer:
* type: gcp:compute:ForwardingRule
* name: psc_ilb_consumer
* properties:
* name: psc-ilb-consumer-forwarding-rule
* region: us-west2
* target: ${pscIlbServiceAttachment.id}
* loadBalancingScheme:
* network: ${pscIlbConsumerNetwork.id}
* subnetwork: ${pscIlbConsumerSubnetwork.id}
* ipAddress: ${pscIlbConsumerAddress.id}
* pscIlbTargetService:
* type: gcp:compute:ForwardingRule
* name: psc_ilb_target_service
* properties:
* name: producer-forwarding-rule
* region: us-west2
* loadBalancingScheme: INTERNAL
* backendService: ${producerServiceBackend.id}
* allPorts: true
* network: ${pscIlbNetwork.name}
* subnetwork: ${pscIlbProducerSubnetwork.name}
* producerServiceBackend:
* type: gcp:compute:RegionBackendService
* name: producer_service_backend
* properties:
* name: producer-service
* region: us-west2
* healthChecks: ${producerServiceHealthCheck.id}
* producerServiceHealthCheck:
* type: gcp:compute:HealthCheck
* name: producer_service_health_check
* properties:
* name: producer-service-health-check
* checkIntervalSec: 1
* timeoutSec: 1
* tcpHealthCheck:
* port: '80'
* pscIlbNetwork:
* type: gcp:compute:Network
* name: psc_ilb_network
* properties:
* name: psc-ilb-network
* autoCreateSubnetworks: false
* pscIlbProducerSubnetwork:
* type: gcp:compute:Subnetwork
* name: psc_ilb_producer_subnetwork
* properties:
* name: psc-ilb-producer-subnetwork
* region: us-west2
* network: ${pscIlbNetwork.id}
* ipCidrRange: 10.0.0.0/16
* pscIlbNat:
* type: gcp:compute:Subnetwork
* name: psc_ilb_nat
* properties:
* name: psc-ilb-nat
* region: us-west2
* network: ${pscIlbNetwork.id}
* purpose: PRIVATE_SERVICE_CONNECT
* ipCidrRange: 10.1.0.0/16
* ```
*
* ### Service Attachment Reconcile Connections
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
* const producerServiceHealthCheck = new gcp.compute.HealthCheck("producer_service_health_check", {
* name: "producer-service-health-check",
* checkIntervalSec: 1,
* timeoutSec: 1,
* tcpHealthCheck: {
* port: 80,
* },
* });
* const producerServiceBackend = new gcp.compute.RegionBackendService("producer_service_backend", {
* name: "producer-service",
* region: "us-west2",
* healthChecks: producerServiceHealthCheck.id,
* });
* const pscIlbNetwork = new gcp.compute.Network("psc_ilb_network", {
* name: "psc-ilb-network",
* autoCreateSubnetworks: false,
* });
* const pscIlbProducerSubnetwork = new gcp.compute.Subnetwork("psc_ilb_producer_subnetwork", {
* name: "psc-ilb-producer-subnetwork",
* region: "us-west2",
* network: pscIlbNetwork.id,
* ipCidrRange: "10.0.0.0/16",
* });
* const pscIlbTargetService = new gcp.compute.ForwardingRule("psc_ilb_target_service", {
* name: "producer-forwarding-rule",
* region: "us-west2",
* loadBalancingScheme: "INTERNAL",
* backendService: producerServiceBackend.id,
* allPorts: true,
* network: pscIlbNetwork.name,
* subnetwork: pscIlbProducerSubnetwork.name,
* });
* const pscIlbNat = new gcp.compute.Subnetwork("psc_ilb_nat", {
* name: "psc-ilb-nat",
* region: "us-west2",
* network: pscIlbNetwork.id,
* purpose: "PRIVATE_SERVICE_CONNECT",
* ipCidrRange: "10.1.0.0/16",
* });
* const pscIlbServiceAttachment = new gcp.compute.ServiceAttachment("psc_ilb_service_attachment", {
* name: "my-psc-ilb",
* region: "us-west2",
* description: "A service attachment configured with Terraform",
* domainNames: ["gcp.tfacc.hashicorptest.com."],
* enableProxyProtocol: true,
* connectionPreference: "ACCEPT_MANUAL",
* natSubnets: [pscIlbNat.id],
* targetService: pscIlbTargetService.id,
* consumerRejectLists: [
* "673497134629",
* "482878270665",
* ],
* consumerAcceptLists: [{
* projectIdOrNum: "658859330310",
* connectionLimit: 4,
* }],
* reconcileConnections: false,
* });
* ```
* ```python
* import pulumi
* import pulumi_gcp as gcp
* producer_service_health_check = gcp.compute.HealthCheck("producer_service_health_check",
* name="producer-service-health-check",
* check_interval_sec=1,
* timeout_sec=1,
* tcp_health_check={
* "port": 80,
* })
* producer_service_backend = gcp.compute.RegionBackendService("producer_service_backend",
* name="producer-service",
* region="us-west2",
* health_checks=producer_service_health_check.id)
* psc_ilb_network = gcp.compute.Network("psc_ilb_network",
* name="psc-ilb-network",
* auto_create_subnetworks=False)
* psc_ilb_producer_subnetwork = gcp.compute.Subnetwork("psc_ilb_producer_subnetwork",
* name="psc-ilb-producer-subnetwork",
* region="us-west2",
* network=psc_ilb_network.id,
* ip_cidr_range="10.0.0.0/16")
* psc_ilb_target_service = gcp.compute.ForwardingRule("psc_ilb_target_service",
* name="producer-forwarding-rule",
* region="us-west2",
* load_balancing_scheme="INTERNAL",
* backend_service=producer_service_backend.id,
* all_ports=True,
* network=psc_ilb_network.name,
* subnetwork=psc_ilb_producer_subnetwork.name)
* psc_ilb_nat = gcp.compute.Subnetwork("psc_ilb_nat",
* name="psc-ilb-nat",
* region="us-west2",
* network=psc_ilb_network.id,
* purpose="PRIVATE_SERVICE_CONNECT",
* ip_cidr_range="10.1.0.0/16")
* psc_ilb_service_attachment = gcp.compute.ServiceAttachment("psc_ilb_service_attachment",
* name="my-psc-ilb",
* region="us-west2",
* description="A service attachment configured with Terraform",
* domain_names=["gcp.tfacc.hashicorptest.com."],
* enable_proxy_protocol=True,
* connection_preference="ACCEPT_MANUAL",
* nat_subnets=[psc_ilb_nat.id],
* target_service=psc_ilb_target_service.id,
* consumer_reject_lists=[
* "673497134629",
* "482878270665",
* ],
* consumer_accept_lists=[{
* "project_id_or_num": "658859330310",
* "connection_limit": 4,
* }],
* reconcile_connections=False)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Gcp = Pulumi.Gcp;
* return await Deployment.RunAsync(() =>
* {
* var producerServiceHealthCheck = new Gcp.Compute.HealthCheck("producer_service_health_check", new()
* {
* Name = "producer-service-health-check",
* CheckIntervalSec = 1,
* TimeoutSec = 1,
* TcpHealthCheck = new Gcp.Compute.Inputs.HealthCheckTcpHealthCheckArgs
* {
* Port = 80,
* },
* });
* var producerServiceBackend = new Gcp.Compute.RegionBackendService("producer_service_backend", new()
* {
* Name = "producer-service",
* Region = "us-west2",
* HealthChecks = producerServiceHealthCheck.Id,
* });
* var pscIlbNetwork = new Gcp.Compute.Network("psc_ilb_network", new()
* {
* Name = "psc-ilb-network",
* AutoCreateSubnetworks = false,
* });
* var pscIlbProducerSubnetwork = new Gcp.Compute.Subnetwork("psc_ilb_producer_subnetwork", new()
* {
* Name = "psc-ilb-producer-subnetwork",
* Region = "us-west2",
* Network = pscIlbNetwork.Id,
* IpCidrRange = "10.0.0.0/16",
* });
* var pscIlbTargetService = new Gcp.Compute.ForwardingRule("psc_ilb_target_service", new()
* {
* Name = "producer-forwarding-rule",
* Region = "us-west2",
* LoadBalancingScheme = "INTERNAL",
* BackendService = producerServiceBackend.Id,
* AllPorts = true,
* Network = pscIlbNetwork.Name,
* Subnetwork = pscIlbProducerSubnetwork.Name,
* });
* var pscIlbNat = new Gcp.Compute.Subnetwork("psc_ilb_nat", new()
* {
* Name = "psc-ilb-nat",
* Region = "us-west2",
* Network = pscIlbNetwork.Id,
* Purpose = "PRIVATE_SERVICE_CONNECT",
* IpCidrRange = "10.1.0.0/16",
* });
* var pscIlbServiceAttachment = new Gcp.Compute.ServiceAttachment("psc_ilb_service_attachment", new()
* {
* Name = "my-psc-ilb",
* Region = "us-west2",
* Description = "A service attachment configured with Terraform",
* DomainNames = new[]
* {
* "gcp.tfacc.hashicorptest.com.",
* },
* EnableProxyProtocol = true,
* ConnectionPreference = "ACCEPT_MANUAL",
* NatSubnets = new[]
* {
* pscIlbNat.Id,
* },
* TargetService = pscIlbTargetService.Id,
* ConsumerRejectLists = new[]
* {
* "673497134629",
* "482878270665",
* },
* ConsumerAcceptLists = new[]
* {
* new Gcp.Compute.Inputs.ServiceAttachmentConsumerAcceptListArgs
* {
* ProjectIdOrNum = "658859330310",
* ConnectionLimit = 4,
* },
* },
* ReconcileConnections = false,
* });
* });
* ```
* ```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 {
* producerServiceHealthCheck, err := compute.NewHealthCheck(ctx, "producer_service_health_check", &compute.HealthCheckArgs{
* Name: pulumi.String("producer-service-health-check"),
* CheckIntervalSec: pulumi.Int(1),
* TimeoutSec: pulumi.Int(1),
* TcpHealthCheck: &compute.HealthCheckTcpHealthCheckArgs{
* Port: pulumi.Int(80),
* },
* })
* if err != nil {
* return err
* }
* producerServiceBackend, err := compute.NewRegionBackendService(ctx, "producer_service_backend", &compute.RegionBackendServiceArgs{
* Name: pulumi.String("producer-service"),
* Region: pulumi.String("us-west2"),
* HealthChecks: producerServiceHealthCheck.ID(),
* })
* if err != nil {
* return err
* }
* pscIlbNetwork, err := compute.NewNetwork(ctx, "psc_ilb_network", &compute.NetworkArgs{
* Name: pulumi.String("psc-ilb-network"),
* AutoCreateSubnetworks: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* pscIlbProducerSubnetwork, err := compute.NewSubnetwork(ctx, "psc_ilb_producer_subnetwork", &compute.SubnetworkArgs{
* Name: pulumi.String("psc-ilb-producer-subnetwork"),
* Region: pulumi.String("us-west2"),
* Network: pscIlbNetwork.ID(),
* IpCidrRange: pulumi.String("10.0.0.0/16"),
* })
* if err != nil {
* return err
* }
* pscIlbTargetService, err := compute.NewForwardingRule(ctx, "psc_ilb_target_service", &compute.ForwardingRuleArgs{
* Name: pulumi.String("producer-forwarding-rule"),
* Region: pulumi.String("us-west2"),
* LoadBalancingScheme: pulumi.String("INTERNAL"),
* BackendService: producerServiceBackend.ID(),
* AllPorts: pulumi.Bool(true),
* Network: pscIlbNetwork.Name,
* Subnetwork: pscIlbProducerSubnetwork.Name,
* })
* if err != nil {
* return err
* }
* pscIlbNat, err := compute.NewSubnetwork(ctx, "psc_ilb_nat", &compute.SubnetworkArgs{
* Name: pulumi.String("psc-ilb-nat"),
* Region: pulumi.String("us-west2"),
* Network: pscIlbNetwork.ID(),
* Purpose: pulumi.String("PRIVATE_SERVICE_CONNECT"),
* IpCidrRange: pulumi.String("10.1.0.0/16"),
* })
* if err != nil {
* return err
* }
* _, err = compute.NewServiceAttachment(ctx, "psc_ilb_service_attachment", &compute.ServiceAttachmentArgs{
* Name: pulumi.String("my-psc-ilb"),
* Region: pulumi.String("us-west2"),
* Description: pulumi.String("A service attachment configured with Terraform"),
* DomainNames: pulumi.StringArray{
* pulumi.String("gcp.tfacc.hashicorptest.com."),
* },
* EnableProxyProtocol: pulumi.Bool(true),
* ConnectionPreference: pulumi.String("ACCEPT_MANUAL"),
* NatSubnets: pulumi.StringArray{
* pscIlbNat.ID(),
* },
* TargetService: pscIlbTargetService.ID(),
* ConsumerRejectLists: pulumi.StringArray{
* pulumi.String("673497134629"),
* pulumi.String("482878270665"),
* },
* ConsumerAcceptLists: compute.ServiceAttachmentConsumerAcceptListArray{
* &compute.ServiceAttachmentConsumerAcceptListArgs{
* ProjectIdOrNum: pulumi.String("658859330310"),
* ConnectionLimit: pulumi.Int(4),
* },
* },
* ReconcileConnections: pulumi.Bool(false),
* })
* 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.HealthCheck;
* import com.pulumi.gcp.compute.HealthCheckArgs;
* import com.pulumi.gcp.compute.inputs.HealthCheckTcpHealthCheckArgs;
* import com.pulumi.gcp.compute.RegionBackendService;
* import com.pulumi.gcp.compute.RegionBackendServiceArgs;
* import com.pulumi.gcp.compute.Network;
* import com.pulumi.gcp.compute.NetworkArgs;
* import com.pulumi.gcp.compute.Subnetwork;
* import com.pulumi.gcp.compute.SubnetworkArgs;
* import com.pulumi.gcp.compute.ForwardingRule;
* import com.pulumi.gcp.compute.ForwardingRuleArgs;
* import com.pulumi.gcp.compute.ServiceAttachment;
* import com.pulumi.gcp.compute.ServiceAttachmentArgs;
* import com.pulumi.gcp.compute.inputs.ServiceAttachmentConsumerAcceptListArgs;
* 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 producerServiceHealthCheck = new HealthCheck("producerServiceHealthCheck", HealthCheckArgs.builder()
* .name("producer-service-health-check")
* .checkIntervalSec(1)
* .timeoutSec(1)
* .tcpHealthCheck(HealthCheckTcpHealthCheckArgs.builder()
* .port("80")
* .build())
* .build());
* var producerServiceBackend = new RegionBackendService("producerServiceBackend", RegionBackendServiceArgs.builder()
* .name("producer-service")
* .region("us-west2")
* .healthChecks(producerServiceHealthCheck.id())
* .build());
* var pscIlbNetwork = new Network("pscIlbNetwork", NetworkArgs.builder()
* .name("psc-ilb-network")
* .autoCreateSubnetworks(false)
* .build());
* var pscIlbProducerSubnetwork = new Subnetwork("pscIlbProducerSubnetwork", SubnetworkArgs.builder()
* .name("psc-ilb-producer-subnetwork")
* .region("us-west2")
* .network(pscIlbNetwork.id())
* .ipCidrRange("10.0.0.0/16")
* .build());
* var pscIlbTargetService = new ForwardingRule("pscIlbTargetService", ForwardingRuleArgs.builder()
* .name("producer-forwarding-rule")
* .region("us-west2")
* .loadBalancingScheme("INTERNAL")
* .backendService(producerServiceBackend.id())
* .allPorts(true)
* .network(pscIlbNetwork.name())
* .subnetwork(pscIlbProducerSubnetwork.name())
* .build());
* var pscIlbNat = new Subnetwork("pscIlbNat", SubnetworkArgs.builder()
* .name("psc-ilb-nat")
* .region("us-west2")
* .network(pscIlbNetwork.id())
* .purpose("PRIVATE_SERVICE_CONNECT")
* .ipCidrRange("10.1.0.0/16")
* .build());
* var pscIlbServiceAttachment = new ServiceAttachment("pscIlbServiceAttachment", ServiceAttachmentArgs.builder()
* .name("my-psc-ilb")
* .region("us-west2")
* .description("A service attachment configured with Terraform")
* .domainNames("gcp.tfacc.hashicorptest.com.")
* .enableProxyProtocol(true)
* .connectionPreference("ACCEPT_MANUAL")
* .natSubnets(pscIlbNat.id())
* .targetService(pscIlbTargetService.id())
* .consumerRejectLists(
* "673497134629",
* "482878270665")
* .consumerAcceptLists(ServiceAttachmentConsumerAcceptListArgs.builder()
* .projectIdOrNum("658859330310")
* .connectionLimit(4)
* .build())
* .reconcileConnections(false)
* .build());
* }
* }
* ```
* ```yaml
* resources:
* pscIlbServiceAttachment:
* type: gcp:compute:ServiceAttachment
* name: psc_ilb_service_attachment
* properties:
* name: my-psc-ilb
* region: us-west2
* description: A service attachment configured with Terraform
* domainNames:
* - gcp.tfacc.hashicorptest.com.
* enableProxyProtocol: true
* connectionPreference: ACCEPT_MANUAL
* natSubnets:
* - ${pscIlbNat.id}
* targetService: ${pscIlbTargetService.id}
* consumerRejectLists:
* - '673497134629'
* - '482878270665'
* consumerAcceptLists:
* - projectIdOrNum: '658859330310'
* connectionLimit: 4
* reconcileConnections: false
* pscIlbTargetService:
* type: gcp:compute:ForwardingRule
* name: psc_ilb_target_service
* properties:
* name: producer-forwarding-rule
* region: us-west2
* loadBalancingScheme: INTERNAL
* backendService: ${producerServiceBackend.id}
* allPorts: true
* network: ${pscIlbNetwork.name}
* subnetwork: ${pscIlbProducerSubnetwork.name}
* producerServiceBackend:
* type: gcp:compute:RegionBackendService
* name: producer_service_backend
* properties:
* name: producer-service
* region: us-west2
* healthChecks: ${producerServiceHealthCheck.id}
* producerServiceHealthCheck:
* type: gcp:compute:HealthCheck
* name: producer_service_health_check
* properties:
* name: producer-service-health-check
* checkIntervalSec: 1
* timeoutSec: 1
* tcpHealthCheck:
* port: '80'
* pscIlbNetwork:
* type: gcp:compute:Network
* name: psc_ilb_network
* properties:
* name: psc-ilb-network
* autoCreateSubnetworks: false
* pscIlbProducerSubnetwork:
* type: gcp:compute:Subnetwork
* name: psc_ilb_producer_subnetwork
* properties:
* name: psc-ilb-producer-subnetwork
* region: us-west2
* network: ${pscIlbNetwork.id}
* ipCidrRange: 10.0.0.0/16
* pscIlbNat:
* type: gcp:compute:Subnetwork
* name: psc_ilb_nat
* properties:
* name: psc-ilb-nat
* region: us-west2
* network: ${pscIlbNetwork.id}
* purpose: PRIVATE_SERVICE_CONNECT
* ipCidrRange: 10.1.0.0/16
* ```
*
* ## Import
* ServiceAttachment can be imported using any of these accepted formats:
* * `projects/{{project}}/regions/{{region}}/serviceAttachments/{{name}}`
* * `{{project}}/{{region}}/{{name}}`
* * `{{region}}/{{name}}`
* * `{{name}}`
* When using the `pulumi import` command, ServiceAttachment can be imported using one of the formats above. For example:
* ```sh
* $ pulumi import gcp:compute/serviceAttachment:ServiceAttachment default projects/{{project}}/regions/{{region}}/serviceAttachments/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/serviceAttachment:ServiceAttachment default {{project}}/{{region}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/serviceAttachment:ServiceAttachment default {{region}}/{{name}}
* ```
* ```sh
* $ pulumi import gcp:compute/serviceAttachment:ServiceAttachment default {{name}}
* ```
* @property connectionPreference The connection preference to use for this service attachment. Valid
* values include "ACCEPT_AUTOMATIC", "ACCEPT_MANUAL".
* @property consumerAcceptLists An array of projects that are allowed to connect to this service
* attachment.
* Structure is documented below.
* @property consumerRejectLists An array of projects that are not allowed to connect to this service
* attachment.
* @property description An optional description of this resource.
* @property domainNames If specified, the domain name will be used during the integration between
* the PSC connected endpoints and the Cloud DNS. For example, this is a
* valid domain name: "p.mycompany.com.". Current max number of domain names
* supported is 1.
* @property enableProxyProtocol If true, enable the proxy protocol which is for supplying client TCP/IP
* address data in TCP connections that traverse proxies on their way to
* destination servers.
* - - -
* @property name Name of the resource. 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 natSubnets An array of subnets that is provided for NAT in this service attachment.
* @property project The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
* @property reconcileConnections This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints.
* If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified .
* If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list.
* @property region URL of the region where the resource resides.
* @property targetService The URL of a service serving the endpoint identified by this service attachment.
*/
public data class ServiceAttachmentArgs(
public val connectionPreference: Output? = null,
public val consumerAcceptLists: Output>? = null,
public val consumerRejectLists: Output>? = null,
public val description: Output? = null,
public val domainNames: Output>? = null,
public val enableProxyProtocol: Output? = null,
public val name: Output? = null,
public val natSubnets: Output>? = null,
public val project: Output? = null,
public val reconcileConnections: Output? = null,
public val region: Output? = null,
public val targetService: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.gcp.compute.ServiceAttachmentArgs =
com.pulumi.gcp.compute.ServiceAttachmentArgs.builder()
.connectionPreference(connectionPreference?.applyValue({ args0 -> args0 }))
.consumerAcceptLists(
consumerAcceptLists?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.consumerRejectLists(consumerRejectLists?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.description(description?.applyValue({ args0 -> args0 }))
.domainNames(domainNames?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.enableProxyProtocol(enableProxyProtocol?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.natSubnets(natSubnets?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
.project(project?.applyValue({ args0 -> args0 }))
.reconcileConnections(reconcileConnections?.applyValue({ args0 -> args0 }))
.region(region?.applyValue({ args0 -> args0 }))
.targetService(targetService?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [ServiceAttachmentArgs].
*/
@PulumiTagMarker
public class ServiceAttachmentArgsBuilder internal constructor() {
private var connectionPreference: Output? = null
private var consumerAcceptLists: Output>? = null
private var consumerRejectLists: Output>? = null
private var description: Output? = null
private var domainNames: Output>? = null
private var enableProxyProtocol: Output? = null
private var name: Output? = null
private var natSubnets: Output>? = null
private var project: Output? = null
private var reconcileConnections: Output? = null
private var region: Output? = null
private var targetService: Output? = null
/**
* @param value The connection preference to use for this service attachment. Valid
* values include "ACCEPT_AUTOMATIC", "ACCEPT_MANUAL".
*/
@JvmName("mjombqbcyrxvlihf")
public suspend fun connectionPreference(`value`: Output) {
this.connectionPreference = value
}
/**
* @param value An array of projects that are allowed to connect to this service
* attachment.
* Structure is documented below.
*/
@JvmName("ebotbejdwdclkoeu")
public suspend fun consumerAcceptLists(`value`: Output>) {
this.consumerAcceptLists = value
}
@JvmName("vbjsndafeaylvshq")
public suspend fun consumerAcceptLists(vararg values: Output) {
this.consumerAcceptLists = Output.all(values.asList())
}
/**
* @param values An array of projects that are allowed to connect to this service
* attachment.
* Structure is documented below.
*/
@JvmName("qaonltinfwhqmdgo")
public suspend fun consumerAcceptLists(values: List>) {
this.consumerAcceptLists = Output.all(values)
}
/**
* @param value An array of projects that are not allowed to connect to this service
* attachment.
*/
@JvmName("wjqqeqsrpmjtfhta")
public suspend fun consumerRejectLists(`value`: Output>) {
this.consumerRejectLists = value
}
@JvmName("wlnsijdwfcdkkhnj")
public suspend fun consumerRejectLists(vararg values: Output) {
this.consumerRejectLists = Output.all(values.asList())
}
/**
* @param values An array of projects that are not allowed to connect to this service
* attachment.
*/
@JvmName("fknqnxuyukhjgkla")
public suspend fun consumerRejectLists(values: List>) {
this.consumerRejectLists = Output.all(values)
}
/**
* @param value An optional description of this resource.
*/
@JvmName("riewfwqvrlkhflmg")
public suspend fun description(`value`: Output) {
this.description = value
}
/**
* @param value If specified, the domain name will be used during the integration between
* the PSC connected endpoints and the Cloud DNS. For example, this is a
* valid domain name: "p.mycompany.com.". Current max number of domain names
* supported is 1.
*/
@JvmName("yxavlepamctqaljs")
public suspend fun domainNames(`value`: Output>) {
this.domainNames = value
}
@JvmName("vspvawycrjwitixu")
public suspend fun domainNames(vararg values: Output) {
this.domainNames = Output.all(values.asList())
}
/**
* @param values If specified, the domain name will be used during the integration between
* the PSC connected endpoints and the Cloud DNS. For example, this is a
* valid domain name: "p.mycompany.com.". Current max number of domain names
* supported is 1.
*/
@JvmName("ptmowrgjvxomjyeq")
public suspend fun domainNames(values: List>) {
this.domainNames = Output.all(values)
}
/**
* @param value If true, enable the proxy protocol which is for supplying client TCP/IP
* address data in TCP connections that traverse proxies on their way to
* destination servers.
* - - -
*/
@JvmName("tmeehwmpyyrabcxp")
public suspend fun enableProxyProtocol(`value`: Output) {
this.enableProxyProtocol = value
}
/**
* @param value Name of the resource. 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("pulcvwokrlxjotjm")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value An array of subnets that is provided for NAT in this service attachment.
*/
@JvmName("bnkeotajotavswuy")
public suspend fun natSubnets(`value`: Output>) {
this.natSubnets = value
}
@JvmName("edspcnmmydroprrp")
public suspend fun natSubnets(vararg values: Output) {
this.natSubnets = Output.all(values.asList())
}
/**
* @param values An array of subnets that is provided for NAT in this service attachment.
*/
@JvmName("omxmquwncjvxhjwu")
public suspend fun natSubnets(values: List>) {
this.natSubnets = Output.all(values)
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("ftnnuhdcgsbfgwuf")
public suspend fun project(`value`: Output) {
this.project = value
}
/**
* @param value This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints.
* If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified .
* If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list.
*/
@JvmName("ttrnvlrhydvjikbw")
public suspend fun reconcileConnections(`value`: Output) {
this.reconcileConnections = value
}
/**
* @param value URL of the region where the resource resides.
*/
@JvmName("gpqilxfwgcrxntai")
public suspend fun region(`value`: Output) {
this.region = value
}
/**
* @param value The URL of a service serving the endpoint identified by this service attachment.
*/
@JvmName("ygpqniogbstxbpuy")
public suspend fun targetService(`value`: Output) {
this.targetService = value
}
/**
* @param value The connection preference to use for this service attachment. Valid
* values include "ACCEPT_AUTOMATIC", "ACCEPT_MANUAL".
*/
@JvmName("asnelehpicpikuut")
public suspend fun connectionPreference(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.connectionPreference = mapped
}
/**
* @param value An array of projects that are allowed to connect to this service
* attachment.
* Structure is documented below.
*/
@JvmName("wudmctkfqmxywgsu")
public suspend fun consumerAcceptLists(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.consumerAcceptLists = mapped
}
/**
* @param argument An array of projects that are allowed to connect to this service
* attachment.
* Structure is documented below.
*/
@JvmName("bhlsvffqkarumayr")
public suspend fun consumerAcceptLists(argument: List Unit>) {
val toBeMapped = argument.toList().map {
ServiceAttachmentConsumerAcceptListArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.consumerAcceptLists = mapped
}
/**
* @param argument An array of projects that are allowed to connect to this service
* attachment.
* Structure is documented below.
*/
@JvmName("opntfrluilwsijpf")
public suspend fun consumerAcceptLists(vararg argument: suspend ServiceAttachmentConsumerAcceptListArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map {
ServiceAttachmentConsumerAcceptListArgsBuilder().applySuspend { it() }.build()
}
val mapped = of(toBeMapped)
this.consumerAcceptLists = mapped
}
/**
* @param argument An array of projects that are allowed to connect to this service
* attachment.
* Structure is documented below.
*/
@JvmName("fhdikolhwsjfgqbx")
public suspend fun consumerAcceptLists(argument: suspend ServiceAttachmentConsumerAcceptListArgsBuilder.() -> Unit) {
val toBeMapped = listOf(
ServiceAttachmentConsumerAcceptListArgsBuilder().applySuspend {
argument()
}.build(),
)
val mapped = of(toBeMapped)
this.consumerAcceptLists = mapped
}
/**
* @param values An array of projects that are allowed to connect to this service
* attachment.
* Structure is documented below.
*/
@JvmName("ukjyhbmmfklaweoq")
public suspend fun consumerAcceptLists(vararg values: ServiceAttachmentConsumerAcceptListArgs) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.consumerAcceptLists = mapped
}
/**
* @param value An array of projects that are not allowed to connect to this service
* attachment.
*/
@JvmName("lollgpbfhtkgycqm")
public suspend fun consumerRejectLists(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.consumerRejectLists = mapped
}
/**
* @param values An array of projects that are not allowed to connect to this service
* attachment.
*/
@JvmName("bsnppflfdknxwgwj")
public suspend fun consumerRejectLists(vararg values: String) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.consumerRejectLists = mapped
}
/**
* @param value An optional description of this resource.
*/
@JvmName("xdpbrimntiifiqvk")
public suspend fun description(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.description = mapped
}
/**
* @param value If specified, the domain name will be used during the integration between
* the PSC connected endpoints and the Cloud DNS. For example, this is a
* valid domain name: "p.mycompany.com.". Current max number of domain names
* supported is 1.
*/
@JvmName("dhhimlstpfkdeyxg")
public suspend fun domainNames(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.domainNames = mapped
}
/**
* @param values If specified, the domain name will be used during the integration between
* the PSC connected endpoints and the Cloud DNS. For example, this is a
* valid domain name: "p.mycompany.com.". Current max number of domain names
* supported is 1.
*/
@JvmName("gmnudroduvwolojw")
public suspend fun domainNames(vararg values: String) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.domainNames = mapped
}
/**
* @param value If true, enable the proxy protocol which is for supplying client TCP/IP
* address data in TCP connections that traverse proxies on their way to
* destination servers.
* - - -
*/
@JvmName("heacylbutfoehxha")
public suspend fun enableProxyProtocol(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.enableProxyProtocol = mapped
}
/**
* @param value Name of the resource. 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("btkajcetlfpbirae")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value An array of subnets that is provided for NAT in this service attachment.
*/
@JvmName("mvqewepwsauyklex")
public suspend fun natSubnets(`value`: List?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.natSubnets = mapped
}
/**
* @param values An array of subnets that is provided for NAT in this service attachment.
*/
@JvmName("xcxujomellihvdtb")
public suspend fun natSubnets(vararg values: String) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.natSubnets = mapped
}
/**
* @param value The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
@JvmName("vkrxxrffjktjjvte")
public suspend fun project(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.project = mapped
}
/**
* @param value This flag determines whether a consumer accept/reject list change can reconcile the statuses of existing ACCEPTED or REJECTED PSC endpoints.
* If false, connection policy update will only affect existing PENDING PSC endpoints. Existing ACCEPTED/REJECTED endpoints will remain untouched regardless how the connection policy is modified .
* If true, update will affect both PENDING and ACCEPTED/REJECTED PSC endpoints. For example, an ACCEPTED PSC endpoint will be moved to REJECTED if its project is added to the reject list.
*/
@JvmName("iqwfrifwbvqbsmbk")
public suspend fun reconcileConnections(`value`: Boolean?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.reconcileConnections = mapped
}
/**
* @param value URL of the region where the resource resides.
*/
@JvmName("yuxpthsceqbpcukw")
public suspend fun region(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.region = mapped
}
/**
* @param value The URL of a service serving the endpoint identified by this service attachment.
*/
@JvmName("glnuqerhfkiiujfy")
public suspend fun targetService(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.targetService = mapped
}
internal fun build(): ServiceAttachmentArgs = ServiceAttachmentArgs(
connectionPreference = connectionPreference,
consumerAcceptLists = consumerAcceptLists,
consumerRejectLists = consumerRejectLists,
description = description,
domainNames = domainNames,
enableProxyProtocol = enableProxyProtocol,
name = name,
natSubnets = natSubnets,
project = project,
reconcileConnections = reconcileConnections,
region = region,
targetService = targetService,
)
}