UNPKG

@pulumi/gcp

Version:

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

124 lines (123 loc) 4.61 kB
import * as pulumi from "@pulumi/pulumi"; /** * Generate service identity for a service. * * > **Note:** Once created, this resource cannot be updated or destroyed. These * actions are a no-op. * * > **Note:** This resource can be used to retrieve the emails of the [Google-managed service accounts](https://cloud.google.com/iam/docs/service-agents) * of the APIs that Google has configured with a Service Identity. You can run `gcloud beta services identity create --service SERVICE_NAME.googleapis.com` to * verify if an API supports this. * * To get more information about Service Identity, see: * * * [API documentation](https://cloud.google.com/service-usage/docs/reference/rest/v1beta1/services/generateServiceIdentity) * * ## Example Usage * * ### Service Identity Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const hcSa = new gcp.projects.ServiceIdentity("hc_sa", { * project: project.then(project => project.projectId), * service: "healthcare.googleapis.com", * }); * const hcSaBqJobuser = new gcp.projects.IAMMember("hc_sa_bq_jobuser", { * project: project.then(project => project.projectId), * role: "roles/bigquery.jobUser", * member: hcSa.member, * }); * ``` * * ## Import * * This resource does not support import. */ export declare class ServiceIdentity extends pulumi.CustomResource { /** * Get an existing ServiceIdentity 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?: ServiceIdentityState, opts?: pulumi.CustomResourceOptions): ServiceIdentity; /** * Returns true if the given object is an instance of ServiceIdentity. 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 ServiceIdentity; /** * The email address of the Google managed service account. */ readonly email: pulumi.Output<string>; /** * The Identity of the Google managed service account in the form 'serviceAccount:{email}'. This value is often used to refer to the service account in order to grant IAM permissions. */ readonly member: 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>; /** * The service to generate identity for. * * - - - */ readonly service: pulumi.Output<string>; /** * Create a ServiceIdentity 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: ServiceIdentityArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering ServiceIdentity resources. */ export interface ServiceIdentityState { /** * The email address of the Google managed service account. */ email?: pulumi.Input<string>; /** * The Identity of the Google managed service account in the form 'serviceAccount:{email}'. This value is often used to refer to the service account in order to grant IAM permissions. */ member?: 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 service to generate identity for. * * - - - */ service?: pulumi.Input<string>; } /** * The set of arguments for constructing a ServiceIdentity resource. */ export interface ServiceIdentityArgs { /** * 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 service to generate identity for. * * - - - */ service: pulumi.Input<string>; }