Expand description
Represents a ServiceAttachment resource.
To get more information about ServiceAttachment, see:
§Example Usage
§Service Attachment Basic
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
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
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
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:
$ pulumi import gcp:compute/serviceAttachment:ServiceAttachment default projects/{{project}}/regions/{{region}}/serviceAttachments/{{name}}
$ pulumi import gcp:compute/serviceAttachment:ServiceAttachment default {{project}}/{{region}}/{{name}}
$ pulumi import gcp:compute/serviceAttachment:ServiceAttachment default {{region}}/{{name}}
$ pulumi import gcp:compute/serviceAttachment:ServiceAttachment default {{name}}
Structs§
- Use builder syntax to set the inputs and finish with
build_struct()
.
Functions§
- Registers a new resource with the given unique name and arguments