gcp.apigee.EndpointAttachment
Explore with Pulumi AI
Apigee Endpoint Attachment.
To get more information about EndpointAttachment, see:
- API documentation
- How-to Guides
Example Usage
Apigee Endpoint Attachment Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const current = gcp.organizations.getClientConfig({});
const apigeeNetwork = new gcp.compute.Network("apigee_network", {name: "apigee-network"});
const apigeeRange = new gcp.compute.GlobalAddress("apigee_range", {
name: "apigee-range",
purpose: "VPC_PEERING",
addressType: "INTERNAL",
prefixLength: 16,
network: apigeeNetwork.id,
});
const apigeeVpcConnection = new gcp.servicenetworking.Connection("apigee_vpc_connection", {
network: apigeeNetwork.id,
service: "servicenetworking.googleapis.com",
reservedPeeringRanges: [apigeeRange.name],
});
const apigeeOrg = new gcp.apigee.Organization("apigee_org", {
analyticsRegion: "us-central1",
projectId: current.then(current => current.project),
authorizedNetwork: apigeeNetwork.id,
}, {
dependsOn: [apigeeVpcConnection],
});
const apigeeEndpointAttachment = new gcp.apigee.EndpointAttachment("apigee_endpoint_attachment", {
orgId: apigeeOrg.id,
endpointAttachmentId: "test1",
location: "{google_compute_service_attachment location}",
serviceAttachment: "{google_compute_service_attachment id}",
});
import pulumi
import pulumi_gcp as gcp
current = gcp.organizations.get_client_config()
apigee_network = gcp.compute.Network("apigee_network", name="apigee-network")
apigee_range = gcp.compute.GlobalAddress("apigee_range",
name="apigee-range",
purpose="VPC_PEERING",
address_type="INTERNAL",
prefix_length=16,
network=apigee_network.id)
apigee_vpc_connection = gcp.servicenetworking.Connection("apigee_vpc_connection",
network=apigee_network.id,
service="servicenetworking.googleapis.com",
reserved_peering_ranges=[apigee_range.name])
apigee_org = gcp.apigee.Organization("apigee_org",
analytics_region="us-central1",
project_id=current.project,
authorized_network=apigee_network.id,
opts = pulumi.ResourceOptions(depends_on=[apigee_vpc_connection]))
apigee_endpoint_attachment = gcp.apigee.EndpointAttachment("apigee_endpoint_attachment",
org_id=apigee_org.id,
endpoint_attachment_id="test1",
location="{google_compute_service_attachment location}",
service_attachment="{google_compute_service_attachment id}")
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/apigee"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/servicenetworking"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
current, err := organizations.GetClientConfig(ctx, nil, nil)
if err != nil {
return err
}
apigeeNetwork, err := compute.NewNetwork(ctx, "apigee_network", &compute.NetworkArgs{
Name: pulumi.String("apigee-network"),
})
if err != nil {
return err
}
apigeeRange, err := compute.NewGlobalAddress(ctx, "apigee_range", &compute.GlobalAddressArgs{
Name: pulumi.String("apigee-range"),
Purpose: pulumi.String("VPC_PEERING"),
AddressType: pulumi.String("INTERNAL"),
PrefixLength: pulumi.Int(16),
Network: apigeeNetwork.ID(),
})
if err != nil {
return err
}
apigeeVpcConnection, err := servicenetworking.NewConnection(ctx, "apigee_vpc_connection", &servicenetworking.ConnectionArgs{
Network: apigeeNetwork.ID(),
Service: pulumi.String("servicenetworking.googleapis.com"),
ReservedPeeringRanges: pulumi.StringArray{
apigeeRange.Name,
},
})
if err != nil {
return err
}
apigeeOrg, err := apigee.NewOrganization(ctx, "apigee_org", &apigee.OrganizationArgs{
AnalyticsRegion: pulumi.String("us-central1"),
ProjectId: pulumi.String(current.Project),
AuthorizedNetwork: apigeeNetwork.ID(),
}, pulumi.DependsOn([]pulumi.Resource{
apigeeVpcConnection,
}))
if err != nil {
return err
}
_, err = apigee.NewEndpointAttachment(ctx, "apigee_endpoint_attachment", &apigee.EndpointAttachmentArgs{
OrgId: apigeeOrg.ID(),
EndpointAttachmentId: pulumi.String("test1"),
Location: pulumi.String("{google_compute_service_attachment location}"),
ServiceAttachment: pulumi.String("{google_compute_service_attachment id}"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var current = Gcp.Organizations.GetClientConfig.Invoke();
var apigeeNetwork = new Gcp.Compute.Network("apigee_network", new()
{
Name = "apigee-network",
});
var apigeeRange = new Gcp.Compute.GlobalAddress("apigee_range", new()
{
Name = "apigee-range",
Purpose = "VPC_PEERING",
AddressType = "INTERNAL",
PrefixLength = 16,
Network = apigeeNetwork.Id,
});
var apigeeVpcConnection = new Gcp.ServiceNetworking.Connection("apigee_vpc_connection", new()
{
Network = apigeeNetwork.Id,
Service = "servicenetworking.googleapis.com",
ReservedPeeringRanges = new[]
{
apigeeRange.Name,
},
});
var apigeeOrg = new Gcp.Apigee.Organization("apigee_org", new()
{
AnalyticsRegion = "us-central1",
ProjectId = current.Apply(getClientConfigResult => getClientConfigResult.Project),
AuthorizedNetwork = apigeeNetwork.Id,
}, new CustomResourceOptions
{
DependsOn =
{
apigeeVpcConnection,
},
});
var apigeeEndpointAttachment = new Gcp.Apigee.EndpointAttachment("apigee_endpoint_attachment", new()
{
OrgId = apigeeOrg.Id,
EndpointAttachmentId = "test1",
Location = "{google_compute_service_attachment location}",
ServiceAttachment = "{google_compute_service_attachment id}",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.OrganizationsFunctions;
import com.pulumi.gcp.compute.Network;
import com.pulumi.gcp.compute.NetworkArgs;
import com.pulumi.gcp.compute.GlobalAddress;
import com.pulumi.gcp.compute.GlobalAddressArgs;
import com.pulumi.gcp.servicenetworking.Connection;
import com.pulumi.gcp.servicenetworking.ConnectionArgs;
import com.pulumi.gcp.apigee.Organization;
import com.pulumi.gcp.apigee.OrganizationArgs;
import com.pulumi.gcp.apigee.EndpointAttachment;
import com.pulumi.gcp.apigee.EndpointAttachmentArgs;
import com.pulumi.resources.CustomResourceOptions;
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) {
final var current = OrganizationsFunctions.getClientConfig();
var apigeeNetwork = new Network("apigeeNetwork", NetworkArgs.builder()
.name("apigee-network")
.build());
var apigeeRange = new GlobalAddress("apigeeRange", GlobalAddressArgs.builder()
.name("apigee-range")
.purpose("VPC_PEERING")
.addressType("INTERNAL")
.prefixLength(16)
.network(apigeeNetwork.id())
.build());
var apigeeVpcConnection = new Connection("apigeeVpcConnection", ConnectionArgs.builder()
.network(apigeeNetwork.id())
.service("servicenetworking.googleapis.com")
.reservedPeeringRanges(apigeeRange.name())
.build());
var apigeeOrg = new Organization("apigeeOrg", OrganizationArgs.builder()
.analyticsRegion("us-central1")
.projectId(current.applyValue(getClientConfigResult -> getClientConfigResult.project()))
.authorizedNetwork(apigeeNetwork.id())
.build(), CustomResourceOptions.builder()
.dependsOn(apigeeVpcConnection)
.build());
var apigeeEndpointAttachment = new EndpointAttachment("apigeeEndpointAttachment", EndpointAttachmentArgs.builder()
.orgId(apigeeOrg.id())
.endpointAttachmentId("test1")
.location("{google_compute_service_attachment location}")
.serviceAttachment("{google_compute_service_attachment id}")
.build());
}
}
resources:
apigeeNetwork:
type: gcp:compute:Network
name: apigee_network
properties:
name: apigee-network
apigeeRange:
type: gcp:compute:GlobalAddress
name: apigee_range
properties:
name: apigee-range
purpose: VPC_PEERING
addressType: INTERNAL
prefixLength: 16
network: ${apigeeNetwork.id}
apigeeVpcConnection:
type: gcp:servicenetworking:Connection
name: apigee_vpc_connection
properties:
network: ${apigeeNetwork.id}
service: servicenetworking.googleapis.com
reservedPeeringRanges:
- ${apigeeRange.name}
apigeeOrg:
type: gcp:apigee:Organization
name: apigee_org
properties:
analyticsRegion: us-central1
projectId: ${current.project}
authorizedNetwork: ${apigeeNetwork.id}
options:
dependson:
- ${apigeeVpcConnection}
apigeeEndpointAttachment:
type: gcp:apigee:EndpointAttachment
name: apigee_endpoint_attachment
properties:
orgId: ${apigeeOrg.id}
endpointAttachmentId: test1
location: '{google_compute_service_attachment location}'
serviceAttachment: '{google_compute_service_attachment id}'
variables:
current:
fn::invoke:
Function: gcp:organizations:getClientConfig
Arguments: {}
Create EndpointAttachment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new EndpointAttachment(name: string, args: EndpointAttachmentArgs, opts?: CustomResourceOptions);
@overload
def EndpointAttachment(resource_name: str,
args: EndpointAttachmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def EndpointAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
endpoint_attachment_id: Optional[str] = None,
location: Optional[str] = None,
org_id: Optional[str] = None,
service_attachment: Optional[str] = None)
func NewEndpointAttachment(ctx *Context, name string, args EndpointAttachmentArgs, opts ...ResourceOption) (*EndpointAttachment, error)
public EndpointAttachment(string name, EndpointAttachmentArgs args, CustomResourceOptions? opts = null)
public EndpointAttachment(String name, EndpointAttachmentArgs args)
public EndpointAttachment(String name, EndpointAttachmentArgs args, CustomResourceOptions options)
type: gcp:apigee:EndpointAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args EndpointAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args EndpointAttachmentArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args EndpointAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EndpointAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EndpointAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var endpointAttachmentResource = new Gcp.Apigee.EndpointAttachment("endpointAttachmentResource", new()
{
EndpointAttachmentId = "string",
Location = "string",
OrgId = "string",
ServiceAttachment = "string",
});
example, err := apigee.NewEndpointAttachment(ctx, "endpointAttachmentResource", &apigee.EndpointAttachmentArgs{
EndpointAttachmentId: pulumi.String("string"),
Location: pulumi.String("string"),
OrgId: pulumi.String("string"),
ServiceAttachment: pulumi.String("string"),
})
var endpointAttachmentResource = new EndpointAttachment("endpointAttachmentResource", EndpointAttachmentArgs.builder()
.endpointAttachmentId("string")
.location("string")
.orgId("string")
.serviceAttachment("string")
.build());
endpoint_attachment_resource = gcp.apigee.EndpointAttachment("endpointAttachmentResource",
endpoint_attachment_id="string",
location="string",
org_id="string",
service_attachment="string")
const endpointAttachmentResource = new gcp.apigee.EndpointAttachment("endpointAttachmentResource", {
endpointAttachmentId: "string",
location: "string",
orgId: "string",
serviceAttachment: "string",
});
type: gcp:apigee:EndpointAttachment
properties:
endpointAttachmentId: string
location: string
orgId: string
serviceAttachment: string
EndpointAttachment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The EndpointAttachment resource accepts the following input properties:
- Endpoint
Attachment stringId - ID of the endpoint attachment.
- Location string
- Location of the endpoint attachment.
- Org
Id string - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - Service
Attachment string - Format: projects//regions//serviceAttachments/*
- Endpoint
Attachment stringId - ID of the endpoint attachment.
- Location string
- Location of the endpoint attachment.
- Org
Id string - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - Service
Attachment string - Format: projects//regions//serviceAttachments/*
- endpoint
Attachment StringId - ID of the endpoint attachment.
- location String
- Location of the endpoint attachment.
- org
Id String - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - service
Attachment String - Format: projects//regions//serviceAttachments/*
- endpoint
Attachment stringId - ID of the endpoint attachment.
- location string
- Location of the endpoint attachment.
- org
Id string - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - service
Attachment string - Format: projects//regions//serviceAttachments/*
- endpoint_
attachment_ strid - ID of the endpoint attachment.
- location str
- Location of the endpoint attachment.
- org_
id str - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - service_
attachment str - Format: projects//regions//serviceAttachments/*
- endpoint
Attachment StringId - ID of the endpoint attachment.
- location String
- Location of the endpoint attachment.
- org
Id String - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - service
Attachment String - Format: projects//regions//serviceAttachments/*
Outputs
All input properties are implicitly available as output properties. Additionally, the EndpointAttachment resource produces the following output properties:
- Connection
State string - State of the endpoint attachment connection to the service attachment.
- Host string
- Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Name of the Endpoint Attachment in the following format: organizations/{organization}/endpointAttachments/{endpointAttachment}.
- Connection
State string - State of the endpoint attachment connection to the service attachment.
- Host string
- Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server.
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Name of the Endpoint Attachment in the following format: organizations/{organization}/endpointAttachments/{endpointAttachment}.
- connection
State String - State of the endpoint attachment connection to the service attachment.
- host String
- Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Name of the Endpoint Attachment in the following format: organizations/{organization}/endpointAttachments/{endpointAttachment}.
- connection
State string - State of the endpoint attachment connection to the service attachment.
- host string
- Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server.
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- Name of the Endpoint Attachment in the following format: organizations/{organization}/endpointAttachments/{endpointAttachment}.
- connection_
state str - State of the endpoint attachment connection to the service attachment.
- host str
- Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server.
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- Name of the Endpoint Attachment in the following format: organizations/{organization}/endpointAttachments/{endpointAttachment}.
- connection
State String - State of the endpoint attachment connection to the service attachment.
- host String
- Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server.
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- Name of the Endpoint Attachment in the following format: organizations/{organization}/endpointAttachments/{endpointAttachment}.
Look up Existing EndpointAttachment Resource
Get an existing EndpointAttachment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: EndpointAttachmentState, opts?: CustomResourceOptions): EndpointAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
connection_state: Optional[str] = None,
endpoint_attachment_id: Optional[str] = None,
host: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
service_attachment: Optional[str] = None) -> EndpointAttachment
func GetEndpointAttachment(ctx *Context, name string, id IDInput, state *EndpointAttachmentState, opts ...ResourceOption) (*EndpointAttachment, error)
public static EndpointAttachment Get(string name, Input<string> id, EndpointAttachmentState? state, CustomResourceOptions? opts = null)
public static EndpointAttachment get(String name, Output<String> id, EndpointAttachmentState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Connection
State string - State of the endpoint attachment connection to the service attachment.
- Endpoint
Attachment stringId - ID of the endpoint attachment.
- Host string
- Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server.
- Location string
- Location of the endpoint attachment.
- Name string
- Name of the Endpoint Attachment in the following format: organizations/{organization}/endpointAttachments/{endpointAttachment}.
- Org
Id string - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - Service
Attachment string - Format: projects//regions//serviceAttachments/*
- Connection
State string - State of the endpoint attachment connection to the service attachment.
- Endpoint
Attachment stringId - ID of the endpoint attachment.
- Host string
- Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server.
- Location string
- Location of the endpoint attachment.
- Name string
- Name of the Endpoint Attachment in the following format: organizations/{organization}/endpointAttachments/{endpointAttachment}.
- Org
Id string - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - Service
Attachment string - Format: projects//regions//serviceAttachments/*
- connection
State String - State of the endpoint attachment connection to the service attachment.
- endpoint
Attachment StringId - ID of the endpoint attachment.
- host String
- Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server.
- location String
- Location of the endpoint attachment.
- name String
- Name of the Endpoint Attachment in the following format: organizations/{organization}/endpointAttachments/{endpointAttachment}.
- org
Id String - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - service
Attachment String - Format: projects//regions//serviceAttachments/*
- connection
State string - State of the endpoint attachment connection to the service attachment.
- endpoint
Attachment stringId - ID of the endpoint attachment.
- host string
- Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server.
- location string
- Location of the endpoint attachment.
- name string
- Name of the Endpoint Attachment in the following format: organizations/{organization}/endpointAttachments/{endpointAttachment}.
- org
Id string - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - service
Attachment string - Format: projects//regions//serviceAttachments/*
- connection_
state str - State of the endpoint attachment connection to the service attachment.
- endpoint_
attachment_ strid - ID of the endpoint attachment.
- host str
- Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server.
- location str
- Location of the endpoint attachment.
- name str
- Name of the Endpoint Attachment in the following format: organizations/{organization}/endpointAttachments/{endpointAttachment}.
- org_
id str - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - service_
attachment str - Format: projects//regions//serviceAttachments/*
- connection
State String - State of the endpoint attachment connection to the service attachment.
- endpoint
Attachment StringId - ID of the endpoint attachment.
- host String
- Host that can be used in either HTTP Target Endpoint directly, or as the host in Target Server.
- location String
- Location of the endpoint attachment.
- name String
- Name of the Endpoint Attachment in the following format: organizations/{organization}/endpointAttachments/{endpointAttachment}.
- org
Id String - The Apigee Organization associated with the Apigee instance,
in the format
organizations/{{org_name}}
. - service
Attachment String - Format: projects//regions//serviceAttachments/*
Import
EndpointAttachment can be imported using any of these accepted formats:
{{org_id}}/endpointAttachments/{{endpoint_attachment_id}}
{{org_id}}/{{endpoint_attachment_id}}
When using the pulumi import
command, EndpointAttachment can be imported using one of the formats above. For example:
$ pulumi import gcp:apigee/endpointAttachment:EndpointAttachment default {{org_id}}/endpointAttachments/{{endpoint_attachment_id}}
$ pulumi import gcp:apigee/endpointAttachment:EndpointAttachment default {{org_id}}/{{endpoint_attachment_id}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.