SharedVPCServiceProject class
Enables the Google Compute Engine Shared VPC feature for a project, assigning it as a Shared VPC service project associated with a given host project.
For more information, see, the Project API documentation, where the Shared VPC feature is referred to by its former name "XPN".
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const service1 = new gcp.compute.SharedVPCServiceProject("service1", {
hostProject: "host-project-id",
serviceProject: "service-project-id-1",
});
import pulumi
import pulumi_gcp as gcp
service1 = gcp.compute.SharedVPCServiceProject("service1",
host_project="host-project-id",
service_project="service-project-id-1")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var service1 = new Gcp.Compute.SharedVPCServiceProject("service1", new()
{
HostProject = "host-project-id",
ServiceProject = "service-project-id-1",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewSharedVPCServiceProject(ctx, "service1", &compute.SharedVPCServiceProjectArgs{
HostProject: pulumi.String("host-project-id"),
ServiceProject: pulumi.String("service-project-id-1"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_compute_sharedvpcserviceproject" "service1" {
host_project = "host-project-id"
service_project = "service-project-id-1"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.SharedVPCServiceProject;
import com.pulumi.gcp.compute.SharedVPCServiceProjectArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var service1 = new SharedVPCServiceProject("service1", SharedVPCServiceProjectArgs.builder()
.hostProject("host-project-id")
.serviceProject("service-project-id-1")
.build());
}
}
resources:
service1:
type: gcp:compute:SharedVPCServiceProject
properties:
hostProject: host-project-id
serviceProject: service-project-id-1
For a complete Shared VPC example with both host and service projects, see
gcp.compute.SharedVPCHostProject.
Import
Google Compute Engine Shared VPC service project feature can be imported using the hostProject and serviceProject, e.g.
{{host_project}/{{service_project}}
When using the pulumi import command, Google Compute Engine Shared VPC service project can be imported using one of the formats above. For example:
$ terraform import google_compute_shared_vpc_service_project.default {{host_project}/{{service_project}}
Constructors
-
Creates a new SharedVPCServiceProject.
nameThe Pulumi resource name.argsArguments used to configure this SharedVPCServiceProject. The set of arguments for SharedVPCServiceProject.optionsResource options controlling this resource's behavior. - Creates a typed reference to an existing SharedVPCServiceProject resource.
Properties
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
deletionPolicy
↔ Output<
String?> -
The deletion policy for the shared VPC service. Setting ABANDON allows the resource to be abandoned rather than deleted. Possible values are: "ABANDON".
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
hostProject
↔ Output<
String> -
The ID of a host project to associate.
latefinal
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
serviceProject
↔ Output<
String> -
The ID of the project that will serve as a Shared VPC service project.
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {SharedVPCServiceProjectState? state, CustomResourceOptions? options}) → SharedVPCServiceProject -
Gets an existing SharedVPCServiceProject resource's state with the given
nameandid.