gcp.apigee.EnvGroupAttachment
Explore with Pulumi AI
An Environment Group attachment
in Apigee.
To get more information about EnvgroupAttachment, see:
- API documentation
- How-to Guides
Example Usage
Apigee Environment Group Attachment Basic
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var project = new Gcp.Organizations.Project("project", new()
{
ProjectId = "my-project",
OrgId = "",
BillingAccount = "",
});
var apigee = new Gcp.Projects.Service("apigee", new()
{
Project = project.ProjectId,
ServiceName = "apigee.googleapis.com",
});
var compute = new Gcp.Projects.Service("compute", new()
{
Project = project.ProjectId,
ServiceName = "compute.googleapis.com",
});
var servicenetworking = new Gcp.Projects.Service("servicenetworking", new()
{
Project = project.ProjectId,
ServiceName = "servicenetworking.googleapis.com",
});
var apigeeNetwork = new Gcp.Compute.Network("apigeeNetwork", new()
{
Project = project.ProjectId,
}, new CustomResourceOptions
{
DependsOn = new[]
{
compute,
},
});
var apigeeRange = new Gcp.Compute.GlobalAddress("apigeeRange", new()
{
Purpose = "VPC_PEERING",
AddressType = "INTERNAL",
PrefixLength = 16,
Network = apigeeNetwork.Id,
Project = project.ProjectId,
});
var apigeeVpcConnection = new Gcp.ServiceNetworking.Connection("apigeeVpcConnection", new()
{
Network = apigeeNetwork.Id,
Service = "servicenetworking.googleapis.com",
ReservedPeeringRanges = new[]
{
apigeeRange.Name,
},
}, new CustomResourceOptions
{
DependsOn = new[]
{
servicenetworking,
},
});
var apigeeOrg = new Gcp.Apigee.Organization("apigeeOrg", new()
{
AnalyticsRegion = "us-central1",
ProjectId = project.ProjectId,
AuthorizedNetwork = apigeeNetwork.Id,
}, new CustomResourceOptions
{
DependsOn = new[]
{
apigeeVpcConnection,
apigee,
},
});
var apigeeEnvgroup = new Gcp.Apigee.EnvGroup("apigeeEnvgroup", new()
{
OrgId = apigeeOrg.Id,
Hostnames = new[]
{
"abc.foo.com",
},
});
var apigeeEnv = new Gcp.Apigee.Environment("apigeeEnv", new()
{
OrgId = apigeeOrg.Id,
Description = "Apigee Environment",
DisplayName = "my-environment",
});
var envGroupAttachment = new Gcp.Apigee.EnvGroupAttachment("envGroupAttachment", new()
{
EnvgroupId = apigeeEnvgroup.Id,
Environment = apigeeEnv.Name,
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/apigee"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/organizations"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/projects"
"github.com/pulumi/pulumi-gcp/sdk/v6/go/gcp/servicenetworking"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
project, err := organizations.NewProject(ctx, "project", &organizations.ProjectArgs{
ProjectId: pulumi.String("my-project"),
OrgId: pulumi.String(""),
BillingAccount: pulumi.String(""),
})
if err != nil {
return err
}
apigee, err := projects.NewService(ctx, "apigee", &projects.ServiceArgs{
Project: project.ProjectId,
Service: pulumi.String("apigee.googleapis.com"),
})
if err != nil {
return err
}
compute, err := projects.NewService(ctx, "compute", &projects.ServiceArgs{
Project: project.ProjectId,
Service: pulumi.String("compute.googleapis.com"),
})
if err != nil {
return err
}
servicenetworking, err := projects.NewService(ctx, "servicenetworking", &projects.ServiceArgs{
Project: project.ProjectId,
Service: pulumi.String("servicenetworking.googleapis.com"),
})
if err != nil {
return err
}
apigeeNetwork, err := compute.NewNetwork(ctx, "apigeeNetwork", &compute.NetworkArgs{
Project: project.ProjectId,
}, pulumi.DependsOn([]pulumi.Resource{
compute,
}))
if err != nil {
return err
}
apigeeRange, err := compute.NewGlobalAddress(ctx, "apigeeRange", &compute.GlobalAddressArgs{
Purpose: pulumi.String("VPC_PEERING"),
AddressType: pulumi.String("INTERNAL"),
PrefixLength: pulumi.Int(16),
Network: apigeeNetwork.ID(),
Project: project.ProjectId,
})
if err != nil {
return err
}
apigeeVpcConnection, err := servicenetworking.NewConnection(ctx, "apigeeVpcConnection", &servicenetworking.ConnectionArgs{
Network: apigeeNetwork.ID(),
Service: pulumi.String("servicenetworking.googleapis.com"),
ReservedPeeringRanges: pulumi.StringArray{
apigeeRange.Name,
},
}, pulumi.DependsOn([]pulumi.Resource{
servicenetworking,
}))
if err != nil {
return err
}
apigeeOrg, err := apigee.NewOrganization(ctx, "apigeeOrg", &apigee.OrganizationArgs{
AnalyticsRegion: pulumi.String("us-central1"),
ProjectId: project.ProjectId,
AuthorizedNetwork: apigeeNetwork.ID(),
}, pulumi.DependsOn([]pulumi.Resource{
apigeeVpcConnection,
apigee,
}))
if err != nil {
return err
}
apigeeEnvgroup, err := apigee.NewEnvGroup(ctx, "apigeeEnvgroup", &apigee.EnvGroupArgs{
OrgId: apigeeOrg.ID(),
Hostnames: pulumi.StringArray{
pulumi.String("abc.foo.com"),
},
})
if err != nil {
return err
}
apigeeEnv, err := apigee.NewEnvironment(ctx, "apigeeEnv", &apigee.EnvironmentArgs{
OrgId: apigeeOrg.ID(),
Description: pulumi.String("Apigee Environment"),
DisplayName: pulumi.String("my-environment"),
})
if err != nil {
return err
}
_, err = apigee.NewEnvGroupAttachment(ctx, "envGroupAttachment", &apigee.EnvGroupAttachmentArgs{
EnvgroupId: apigeeEnvgroup.ID(),
Environment: apigeeEnv.Name,
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.Project;
import com.pulumi.gcp.organizations.ProjectArgs;
import com.pulumi.gcp.projects.Service;
import com.pulumi.gcp.projects.ServiceArgs;
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.EnvGroup;
import com.pulumi.gcp.apigee.EnvGroupArgs;
import com.pulumi.gcp.apigee.Environment;
import com.pulumi.gcp.apigee.EnvironmentArgs;
import com.pulumi.gcp.apigee.EnvGroupAttachment;
import com.pulumi.gcp.apigee.EnvGroupAttachmentArgs;
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) {
var project = new Project("project", ProjectArgs.builder()
.projectId("my-project")
.orgId("")
.billingAccount("")
.build());
var apigee = new Service("apigee", ServiceArgs.builder()
.project(project.projectId())
.service("apigee.googleapis.com")
.build());
var compute = new Service("compute", ServiceArgs.builder()
.project(project.projectId())
.service("compute.googleapis.com")
.build());
var servicenetworking = new Service("servicenetworking", ServiceArgs.builder()
.project(project.projectId())
.service("servicenetworking.googleapis.com")
.build());
var apigeeNetwork = new Network("apigeeNetwork", NetworkArgs.builder()
.project(project.projectId())
.build(), CustomResourceOptions.builder()
.dependsOn(compute)
.build());
var apigeeRange = new GlobalAddress("apigeeRange", GlobalAddressArgs.builder()
.purpose("VPC_PEERING")
.addressType("INTERNAL")
.prefixLength(16)
.network(apigeeNetwork.id())
.project(project.projectId())
.build());
var apigeeVpcConnection = new Connection("apigeeVpcConnection", ConnectionArgs.builder()
.network(apigeeNetwork.id())
.service("servicenetworking.googleapis.com")
.reservedPeeringRanges(apigeeRange.name())
.build(), CustomResourceOptions.builder()
.dependsOn(servicenetworking)
.build());
var apigeeOrg = new Organization("apigeeOrg", OrganizationArgs.builder()
.analyticsRegion("us-central1")
.projectId(project.projectId())
.authorizedNetwork(apigeeNetwork.id())
.build(), CustomResourceOptions.builder()
.dependsOn(
apigeeVpcConnection,
apigee)
.build());
var apigeeEnvgroup = new EnvGroup("apigeeEnvgroup", EnvGroupArgs.builder()
.orgId(apigeeOrg.id())
.hostnames("abc.foo.com")
.build());
var apigeeEnv = new Environment("apigeeEnv", EnvironmentArgs.builder()
.orgId(apigeeOrg.id())
.description("Apigee Environment")
.displayName("my-environment")
.build());
var envGroupAttachment = new EnvGroupAttachment("envGroupAttachment", EnvGroupAttachmentArgs.builder()
.envgroupId(apigeeEnvgroup.id())
.environment(apigeeEnv.name())
.build());
}
}
import pulumi
import pulumi_gcp as gcp
project = gcp.organizations.Project("project",
project_id="my-project",
org_id="",
billing_account="")
apigee = gcp.projects.Service("apigee",
project=project.project_id,
service="apigee.googleapis.com")
compute = gcp.projects.Service("compute",
project=project.project_id,
service="compute.googleapis.com")
servicenetworking = gcp.projects.Service("servicenetworking",
project=project.project_id,
service="servicenetworking.googleapis.com")
apigee_network = gcp.compute.Network("apigeeNetwork", project=project.project_id,
opts=pulumi.ResourceOptions(depends_on=[compute]))
apigee_range = gcp.compute.GlobalAddress("apigeeRange",
purpose="VPC_PEERING",
address_type="INTERNAL",
prefix_length=16,
network=apigee_network.id,
project=project.project_id)
apigee_vpc_connection = gcp.servicenetworking.Connection("apigeeVpcConnection",
network=apigee_network.id,
service="servicenetworking.googleapis.com",
reserved_peering_ranges=[apigee_range.name],
opts=pulumi.ResourceOptions(depends_on=[servicenetworking]))
apigee_org = gcp.apigee.Organization("apigeeOrg",
analytics_region="us-central1",
project_id=project.project_id,
authorized_network=apigee_network.id,
opts=pulumi.ResourceOptions(depends_on=[
apigee_vpc_connection,
apigee,
]))
apigee_envgroup = gcp.apigee.EnvGroup("apigeeEnvgroup",
org_id=apigee_org.id,
hostnames=["abc.foo.com"])
apigee_env = gcp.apigee.Environment("apigeeEnv",
org_id=apigee_org.id,
description="Apigee Environment",
display_name="my-environment")
env_group_attachment = gcp.apigee.EnvGroupAttachment("envGroupAttachment",
envgroup_id=apigee_envgroup.id,
environment=apigee_env.name)
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const project = new gcp.organizations.Project("project", {
projectId: "my-project",
orgId: "",
billingAccount: "",
});
const apigee = new gcp.projects.Service("apigee", {
project: project.projectId,
service: "apigee.googleapis.com",
});
const compute = new gcp.projects.Service("compute", {
project: project.projectId,
service: "compute.googleapis.com",
});
const servicenetworking = new gcp.projects.Service("servicenetworking", {
project: project.projectId,
service: "servicenetworking.googleapis.com",
});
const apigeeNetwork = new gcp.compute.Network("apigeeNetwork", {project: project.projectId}, {
dependsOn: [compute],
});
const apigeeRange = new gcp.compute.GlobalAddress("apigeeRange", {
purpose: "VPC_PEERING",
addressType: "INTERNAL",
prefixLength: 16,
network: apigeeNetwork.id,
project: project.projectId,
});
const apigeeVpcConnection = new gcp.servicenetworking.Connection("apigeeVpcConnection", {
network: apigeeNetwork.id,
service: "servicenetworking.googleapis.com",
reservedPeeringRanges: [apigeeRange.name],
}, {
dependsOn: [servicenetworking],
});
const apigeeOrg = new gcp.apigee.Organization("apigeeOrg", {
analyticsRegion: "us-central1",
projectId: project.projectId,
authorizedNetwork: apigeeNetwork.id,
}, {
dependsOn: [
apigeeVpcConnection,
apigee,
],
});
const apigeeEnvgroup = new gcp.apigee.EnvGroup("apigeeEnvgroup", {
orgId: apigeeOrg.id,
hostnames: ["abc.foo.com"],
});
const apigeeEnv = new gcp.apigee.Environment("apigeeEnv", {
orgId: apigeeOrg.id,
description: "Apigee Environment",
displayName: "my-environment",
});
const envGroupAttachment = new gcp.apigee.EnvGroupAttachment("envGroupAttachment", {
envgroupId: apigeeEnvgroup.id,
environment: apigeeEnv.name,
});
resources:
project:
type: gcp:organizations:Project
properties:
projectId: my-project
orgId:
billingAccount:
apigee:
type: gcp:projects:Service
properties:
project: ${project.projectId}
service: apigee.googleapis.com
compute:
type: gcp:projects:Service
properties:
project: ${project.projectId}
service: compute.googleapis.com
servicenetworking:
type: gcp:projects:Service
properties:
project: ${project.projectId}
service: servicenetworking.googleapis.com
apigeeNetwork:
type: gcp:compute:Network
properties:
project: ${project.projectId}
options:
dependson:
- ${compute}
apigeeRange:
type: gcp:compute:GlobalAddress
properties:
purpose: VPC_PEERING
addressType: INTERNAL
prefixLength: 16
network: ${apigeeNetwork.id}
project: ${project.projectId}
apigeeVpcConnection:
type: gcp:servicenetworking:Connection
properties:
network: ${apigeeNetwork.id}
service: servicenetworking.googleapis.com
reservedPeeringRanges:
- ${apigeeRange.name}
options:
dependson:
- ${servicenetworking}
apigeeOrg:
type: gcp:apigee:Organization
properties:
analyticsRegion: us-central1
projectId: ${project.projectId}
authorizedNetwork: ${apigeeNetwork.id}
options:
dependson:
- ${apigeeVpcConnection}
- ${apigee}
apigeeEnvgroup:
type: gcp:apigee:EnvGroup
properties:
orgId: ${apigeeOrg.id}
hostnames:
- abc.foo.com
apigeeEnv:
type: gcp:apigee:Environment
properties:
orgId: ${apigeeOrg.id}
description: Apigee Environment
displayName: my-environment
envGroupAttachment:
type: gcp:apigee:EnvGroupAttachment
properties:
envgroupId: ${apigeeEnvgroup.id}
environment: ${apigeeEnv.name}
Create EnvGroupAttachment Resource
new EnvGroupAttachment(name: string, args: EnvGroupAttachmentArgs, opts?: CustomResourceOptions);
@overload
def EnvGroupAttachment(resource_name: str,
opts: Optional[ResourceOptions] = None,
envgroup_id: Optional[str] = None,
environment: Optional[str] = None)
@overload
def EnvGroupAttachment(resource_name: str,
args: EnvGroupAttachmentArgs,
opts: Optional[ResourceOptions] = None)
func NewEnvGroupAttachment(ctx *Context, name string, args EnvGroupAttachmentArgs, opts ...ResourceOption) (*EnvGroupAttachment, error)
public EnvGroupAttachment(string name, EnvGroupAttachmentArgs args, CustomResourceOptions? opts = null)
public EnvGroupAttachment(String name, EnvGroupAttachmentArgs args)
public EnvGroupAttachment(String name, EnvGroupAttachmentArgs args, CustomResourceOptions options)
type: gcp:apigee:EnvGroupAttachment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EnvGroupAttachmentArgs
- 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 EnvGroupAttachmentArgs
- 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 EnvGroupAttachmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EnvGroupAttachmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EnvGroupAttachmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
EnvGroupAttachment 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 EnvGroupAttachment resource accepts the following input properties:
- Envgroup
Id string The Apigee environment group associated with the Apigee environment, in the format
organizations/{{org_name}}/envgroups/{{envgroup_name}}
.- Environment string
The resource ID of the environment.
- Envgroup
Id string The Apigee environment group associated with the Apigee environment, in the format
organizations/{{org_name}}/envgroups/{{envgroup_name}}
.- Environment string
The resource ID of the environment.
- envgroup
Id String The Apigee environment group associated with the Apigee environment, in the format
organizations/{{org_name}}/envgroups/{{envgroup_name}}
.- environment String
The resource ID of the environment.
- envgroup
Id string The Apigee environment group associated with the Apigee environment, in the format
organizations/{{org_name}}/envgroups/{{envgroup_name}}
.- environment string
The resource ID of the environment.
- envgroup_
id str The Apigee environment group associated with the Apigee environment, in the format
organizations/{{org_name}}/envgroups/{{envgroup_name}}
.- environment str
The resource ID of the environment.
- envgroup
Id String The Apigee environment group associated with the Apigee environment, in the format
organizations/{{org_name}}/envgroups/{{envgroup_name}}
.- environment String
The resource ID of the environment.
Outputs
All input properties are implicitly available as output properties. Additionally, the EnvGroupAttachment resource produces the following output properties:
Look up Existing EnvGroupAttachment Resource
Get an existing EnvGroupAttachment 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?: EnvGroupAttachmentState, opts?: CustomResourceOptions): EnvGroupAttachment
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
envgroup_id: Optional[str] = None,
environment: Optional[str] = None,
name: Optional[str] = None) -> EnvGroupAttachment
func GetEnvGroupAttachment(ctx *Context, name string, id IDInput, state *EnvGroupAttachmentState, opts ...ResourceOption) (*EnvGroupAttachment, error)
public static EnvGroupAttachment Get(string name, Input<string> id, EnvGroupAttachmentState? state, CustomResourceOptions? opts = null)
public static EnvGroupAttachment get(String name, Output<String> id, EnvGroupAttachmentState 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.
- Envgroup
Id string The Apigee environment group associated with the Apigee environment, in the format
organizations/{{org_name}}/envgroups/{{envgroup_name}}
.- Environment string
The resource ID of the environment.
- Name string
The name of the newly created attachment (output parameter).
- Envgroup
Id string The Apigee environment group associated with the Apigee environment, in the format
organizations/{{org_name}}/envgroups/{{envgroup_name}}
.- Environment string
The resource ID of the environment.
- Name string
The name of the newly created attachment (output parameter).
- envgroup
Id String The Apigee environment group associated with the Apigee environment, in the format
organizations/{{org_name}}/envgroups/{{envgroup_name}}
.- environment String
The resource ID of the environment.
- name String
The name of the newly created attachment (output parameter).
- envgroup
Id string The Apigee environment group associated with the Apigee environment, in the format
organizations/{{org_name}}/envgroups/{{envgroup_name}}
.- environment string
The resource ID of the environment.
- name string
The name of the newly created attachment (output parameter).
- envgroup_
id str The Apigee environment group associated with the Apigee environment, in the format
organizations/{{org_name}}/envgroups/{{envgroup_name}}
.- environment str
The resource ID of the environment.
- name str
The name of the newly created attachment (output parameter).
- envgroup
Id String The Apigee environment group associated with the Apigee environment, in the format
organizations/{{org_name}}/envgroups/{{envgroup_name}}
.- environment String
The resource ID of the environment.
- name String
The name of the newly created attachment (output parameter).
Import
EnvgroupAttachment can be imported using any of these accepted formats
$ pulumi import gcp:apigee/envGroupAttachment:EnvGroupAttachment default {{envgroup_id}}/attachments/{{name}}
$ pulumi import gcp:apigee/envGroupAttachment:EnvGroupAttachment default {{envgroup_id}}/{{name}}
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.