@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
161 lines (160 loc) • 6.17 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
/**
* An owner is an additional user that may manage a verified web site in the
* [Google Search Console](https://www.google.com/webmasters/tools/). There
* are two types of web resource owners:
*
* * Verified owners, which are added to a web resource automatically when it
* is created (i.e., when the resource is verified). A verified owner is
* determined by the identity of the user requesting verification.
* * Additional owners, which can be added to the resource by verified owners.
*
* `gcp.siteverification.Owner` creates additional owners. If your web site
* was verified using the
* `gcp.siteverification.WebResource`
* resource then you (or the identity was used to create the resource, such as a
* service account) are already an owner.
*
* > **Note:** The email address of the owner must belong to a Google account,
* such as a Gmail account, a Google Workspace account, or a GCP service account.
*
* Working with site verification requires the `https://www.googleapis.com/auth/siteverification`
* authentication scope. See the
* Google Provider authentication documentation
* to learn how to configure additional scopes.
*
* To get more information about site owners, see:
*
* * [API documentation](https://developers.google.com/site-verification/v1)
* * How-to Guides
* * [Getting Started](https://developers.google.com/site-verification/v1/getting_started)
*
* ## Example Usage
*
* ### Site Verification Storage Bucket
*
* This example uses the `FILE` verification method to verify ownership of web site hosted
* in a Google Cloud Storage bucket. Ownership is proved by creating a file with a Google-provided
* value in a known location. The user applying this configuration will automatically be
* added as a verified owner, and the `gcp.siteverification.Owner` resource will add
* `user@example.com` as an additional owner.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const bucket = new gcp.storage.Bucket("bucket", {
* name: "example-storage-bucket",
* location: "US",
* });
* const token = gcp.siteverification.getTokenOutput({
* type: "SITE",
* identifier: pulumi.interpolate`https://${bucket.name}.storage.googleapis.com/`,
* verificationMethod: "FILE",
* });
* const object = new gcp.storage.BucketObject("object", {
* name: token.apply(token => token.token),
* content: token.apply(token => `google-site-verification: ${token.token}`),
* bucket: bucket.name,
* });
* const publicRule = new gcp.storage.ObjectAccessControl("public_rule", {
* bucket: bucket.name,
* object: object.name,
* role: "READER",
* entity: "allUsers",
* });
* const example = new gcp.siteverification.WebResource("example", {
* site: {
* type: token.apply(token => token.type),
* identifier: token.apply(token => token.identifier),
* },
* verificationMethod: token.apply(token => token.verificationMethod),
* });
* const exampleOwner = new gcp.siteverification.Owner("example", {
* webResourceId: example.id,
* email: "user@example.com",
* });
* ```
*
* ## Import
*
* Owner can be imported using this format:
*
* * `webResource/{{web_resource_id}}/{{email}}`
*
* When using the `pulumi import` command, Site owners can be imported using the format above. For example:
*
* ```sh
* $ pulumi import gcp:siteverification/owner:Owner default webResource/{{web_resource_id}}/{{email}}
* ```
*
* verified owners is to delete the web resource itself.
*/
export declare class Owner extends pulumi.CustomResource {
/**
* Get an existing Owner 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?: OwnerState, opts?: pulumi.CustomResourceOptions): Owner;
/**
* Returns true if the given object is an instance of Owner. 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 Owner;
/**
* The email of the user to be added as an owner.
*
* - - -
*/
readonly email: pulumi.Output<string>;
/**
* The id of of the web resource to which the owner will be added, in the form `webResource/<resource_id>`,
* such as `webResource/https://www.example.com/`
*/
readonly webResourceId: pulumi.Output<string>;
/**
* Create a Owner 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: OwnerArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Owner resources.
*/
export interface OwnerState {
/**
* The email of the user to be added as an owner.
*
* - - -
*/
email?: pulumi.Input<string>;
/**
* The id of of the web resource to which the owner will be added, in the form `webResource/<resource_id>`,
* such as `webResource/https://www.example.com/`
*/
webResourceId?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Owner resource.
*/
export interface OwnerArgs {
/**
* The email of the user to be added as an owner.
*
* - - -
*/
email: pulumi.Input<string>;
/**
* The id of of the web resource to which the owner will be added, in the form `webResource/<resource_id>`,
* such as `webResource/https://www.example.com/`
*/
webResourceId: pulumi.Input<string>;
}