UNPKG

@pulumi/gcp

Version:

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

228 lines • 10.4 kB
import * as pulumi from "@pulumi/pulumi"; /** * Runtime project attachment represents an attachment from the runtime project to the host project. API Hub looks for deployments in the attached runtime projects and creates corresponding resources in API Hub for the discovered deployments. * * ## Example Usage * * ### Apihub Runtime Project Attachment Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * import * as time from "@pulumiverse/time"; * * const hostProject = new gcp.organizations.Project("host_project", { * name: "h-ah-proj", * projectId: "h-ah-proj", * orgId: "123456789", * billingAccount: "000000-0000000-0000000-000000", * deletionPolicy: "DELETE", * }); * const wait60Seconds = new time.Sleep("wait_60_seconds", {createDuration: "60s"}, { * dependsOn: [hostProject], * }); * // Enable API hub API on host project * const apihubService = new gcp.projects.Service("apihub_service", { * project: hostProject.projectId, * service: "apihub.googleapis.com", * }, { * dependsOn: [wait60Seconds], * }); * const hostProjectReg = new gcp.apihub.HostProjectRegistration("host_project_reg", { * project: hostProject.projectId, * location: "asia-south1", * hostProjectRegistrationId: hostProject.projectId, * gcpProject: pulumi.interpolate`projects/${hostProject.projectId}`, * }, { * dependsOn: [apihubService], * }); * const runtimeProject = new gcp.organizations.Project("runtime_project", { * name: "r-ah-proj", * projectId: "r-ah-proj", * orgId: "123456789", * billingAccount: "000000-0000000-0000000-000000", * deletionPolicy: "DELETE", * }); * // Enable API hub API on runtime project * const apihubServiceRuntime = new gcp.projects.Service("apihub_service_runtime", { * project: runtimeProject.projectId, * service: "apihub.googleapis.com", * }, { * dependsOn: [wait60Seconds], * }); * const apihubRuntimeProjectAttachment = new gcp.apihub.RuntimeProjectAttachment("apihub_runtime_project_attachment", { * project: hostProject.projectId, * location: "asia-south1", * runtimeProjectAttachmentId: runtimeProject.projectId, * runtimeProject: pulumi.interpolate`projects/${runtimeProject.projectId}`, * }, { * dependsOn: [ * hostProjectReg, * apihubServiceRuntime, * ], * }); * ``` * * ## Import * * RuntimeProjectAttachment can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/runtimeProjectAttachments/{{runtime_project_attachment_id}}` * * `{{project}}/{{location}}/{{runtime_project_attachment_id}}` * * `{{location}}/{{runtime_project_attachment_id}}` * * When using the `pulumi import` command, RuntimeProjectAttachment can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:apihub/runtimeProjectAttachment:RuntimeProjectAttachment default projects/{{project}}/locations/{{location}}/runtimeProjectAttachments/{{runtime_project_attachment_id}} * $ pulumi import gcp:apihub/runtimeProjectAttachment:RuntimeProjectAttachment default {{project}}/{{location}}/{{runtime_project_attachment_id}} * $ pulumi import gcp:apihub/runtimeProjectAttachment:RuntimeProjectAttachment default {{location}}/{{runtime_project_attachment_id}} * ``` */ export declare class RuntimeProjectAttachment extends pulumi.CustomResource { /** * Get an existing RuntimeProjectAttachment 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?: RuntimeProjectAttachmentState, opts?: pulumi.CustomResourceOptions): RuntimeProjectAttachment; /** * Returns true if the given object is an instance of RuntimeProjectAttachment. 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 RuntimeProjectAttachment; /** * Output only. Create time. */ readonly createTime: pulumi.Output<string>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ readonly deletionPolicy: pulumi.Output<string>; /** * Part of `parent`. See documentation of `projectsId`. */ readonly location: pulumi.Output<string>; /** * Identifier. The resource name of a runtime project attachment. * Format: "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment_id}" */ 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>; /** * 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 runtimeProject: pulumi.Output<string>; /** * The ID to use for the Runtime Project Attachment, which will become the * final component of the Runtime Project Attachment's name. The ID must be the same * as the project ID of the Google cloud project specified in the * runtime_project_attachment.runtime_project field. */ readonly runtimeProjectAttachmentId: pulumi.Output<string>; /** * Create a RuntimeProjectAttachment 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: RuntimeProjectAttachmentArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering RuntimeProjectAttachment resources. */ export interface RuntimeProjectAttachmentState { /** * Output only. Create time. */ createTime?: pulumi.Input<string | undefined>; /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * Part of `parent`. See documentation of `projectsId`. */ location?: pulumi.Input<string | undefined>; /** * Identifier. The resource name of a runtime project attachment. * Format: "projects/{project}/locations/{location}/runtimeProjectAttachments/{runtime_project_attachment_id}" */ name?: pulumi.Input<string | undefined>; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input<string | undefined>; /** * 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. */ runtimeProject?: pulumi.Input<string | undefined>; /** * The ID to use for the Runtime Project Attachment, which will become the * final component of the Runtime Project Attachment's name. The ID must be the same * as the project ID of the Google cloud project specified in the * runtime_project_attachment.runtime_project field. */ runtimeProjectAttachmentId?: pulumi.Input<string | undefined>; } /** * The set of arguments for constructing a RuntimeProjectAttachment resource. */ export interface RuntimeProjectAttachmentArgs { /** * Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. * When a 'terraform destroy' or 'pulumi up' would delete the resource, * the command will fail if this field is set to "PREVENT" in Terraform state. * When set to "ABANDON", the command will remove the resource from Terraform * management without updating or deleting the resource in the API. * When set to "DELETE", deleting the resource is allowed. */ deletionPolicy?: pulumi.Input<string | undefined>; /** * 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 | undefined>; /** * 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. */ runtimeProject: pulumi.Input<string>; /** * The ID to use for the Runtime Project Attachment, which will become the * final component of the Runtime Project Attachment's name. The ID must be the same * as the project ID of the Google cloud project specified in the * runtime_project_attachment.runtime_project field. */ runtimeProjectAttachmentId: pulumi.Input<string>; } //# sourceMappingURL=runtimeProjectAttachment.d.ts.map