UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

189 lines (188 loc) 7.84 kB
import * as pulumi from "@pulumi/pulumi"; /** * Host project registration refers to the registration of a Google cloud project with API hub as a host project. * This is the project where API hub is provisioned. * It acts as the consumer project for the API hub instance provisioned. * Multiple runtime projects can be attached to the host project and these attachments define the scope of API hub. * * ## Example Usage * * ### Apihub Host Project Registration Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as time from "@pulumiverse/time"; * * const project = new gcp.organizations.Project("project", { * name: "apihub-proj", * projectId: "apihub-proj", * orgId: "123456789", * billingAccount: "000000-0000000-0000000-000000", * deletionPolicy: "DELETE", * }); * const wait60Seconds = new time.index.Sleep("wait_60_seconds", {createDuration: "60s"}, { * dependsOn: [project], * }); * // Enable API hub API * const apihubService = new gcp.projects.Service("apihub_service", { * project: project.projectId, * service: "apihub.googleapis.com", * }, { * dependsOn: [wait60Seconds], * }); * const apihubHostProject = new gcp.apihub.HostProjectRegistration("apihub_host_project", { * project: project.projectId, * location: "asia-south1", * hostProjectRegistrationId: project.projectId, * gcpProject: pulumi.interpolate`projects/${project.projectId}`, * }, { * dependsOn: [apihubService], * }); * ``` * * ## Import * * HostProjectRegistration can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/hostProjectRegistrations/{{host_project_registration_id}}` * * * `{{project}}/{{location}}/{{host_project_registration_id}}` * * * `{{location}}/{{host_project_registration_id}}` * * When using the `pulumi import` command, HostProjectRegistration can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:apihub/hostProjectRegistration:HostProjectRegistration default projects/{{project}}/locations/{{location}}/hostProjectRegistrations/{{host_project_registration_id}} * ``` * * ```sh * $ pulumi import gcp:apihub/hostProjectRegistration:HostProjectRegistration default {{project}}/{{location}}/{{host_project_registration_id}} * ``` * * ```sh * $ pulumi import gcp:apihub/hostProjectRegistration:HostProjectRegistration default {{location}}/{{host_project_registration_id}} * ``` */ export declare class HostProjectRegistration extends pulumi.CustomResource { /** * Get an existing HostProjectRegistration resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: HostProjectRegistrationState, opts?: pulumi.CustomResourceOptions): HostProjectRegistration; /** * Returns true if the given object is an instance of HostProjectRegistration. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is HostProjectRegistration; /** * Output only. The time at which the host project registration was created. */ readonly createTime: pulumi.Output<string>; /** * Required. Immutable. Google cloud project name in the format: "projects/abc" or "projects/123". * As input, project name with either project id or number are accepted. * As output, this field will contain project number. */ readonly gcpProject: pulumi.Output<string>; /** * Required. The ID to use for the Host Project Registration, which will become the * final component of the host project registration's resource name. The ID * must be the same as the Google cloud project specified in the * host_project_registration.gcp_project field. */ readonly hostProjectRegistrationId: pulumi.Output<string>; /** * Part of `parent`. See documentation of `projectsId`. */ readonly location: pulumi.Output<string>; /** * Identifier. The name of the host project registration. * Format: * "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}". */ readonly name: pulumi.Output<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output<string>; /** * Create a HostProjectRegistration resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: HostProjectRegistrationArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering HostProjectRegistration resources. */ export interface HostProjectRegistrationState { /** * Output only. The time at which the host project registration was created. */ createTime?: pulumi.Input<string>; /** * Required. Immutable. Google cloud project name in the format: "projects/abc" or "projects/123". * As input, project name with either project id or number are accepted. * As output, this field will contain project number. */ gcpProject?: pulumi.Input<string>; /** * Required. The ID to use for the Host Project Registration, which will become the * final component of the host project registration's resource name. The ID * must be the same as the Google cloud project specified in the * host_project_registration.gcp_project field. */ hostProjectRegistrationId?: pulumi.Input<string>; /** * Part of `parent`. See documentation of `projectsId`. */ location?: pulumi.Input<string>; /** * Identifier. The name of the host project registration. * Format: * "projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration}". */ name?: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; } /** * The set of arguments for constructing a HostProjectRegistration resource. */ export interface HostProjectRegistrationArgs { /** * Required. Immutable. Google cloud project name in the format: "projects/abc" or "projects/123". * As input, project name with either project id or number are accepted. * As output, this field will contain project number. */ gcpProject: pulumi.Input<string>; /** * Required. The ID to use for the Host Project Registration, which will become the * final component of the host project registration's resource name. The ID * must be the same as the Google cloud project specified in the * host_project_registration.gcp_project field. */ hostProjectRegistrationId: pulumi.Input<string>; /** * Part of `parent`. See documentation of `projectsId`. */ location: pulumi.Input<string>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string>; }