@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
515 lines (514 loc) • 19.5 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* A Backend is the primary resource of App Hosting.
*
* ## Example Usage
*
* ### Firebase App Hosting Backend Minimal
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* //## Include these blocks only once per project if you are starting from scratch ###
* const serviceAccount = new gcp.serviceaccount.Account("service_account", {
* project: "my-project-name",
* accountId: "firebase-app-hosting-compute",
* displayName: "Firebase App Hosting compute service account",
* createIgnoreAlreadyExists: true,
* });
* const fah = new gcp.projects.Service("fah", {
* project: "my-project-name",
* service: "firebaseapphosting.googleapis.com",
* });
* const example = new gcp.firebase.AppHostingBackend("example", {
* project: "my-project-name",
* location: "us-central1",
* backendId: "mini",
* appId: "1:0000000000:web:674cde32020e16fbce9dbd",
* servingLocality: "GLOBAL_ACCESS",
* serviceAccount: serviceAccount.email,
* }, {
* dependsOn: [fah],
* });
* const appHostingSaRunner = new gcp.projects.IAMMember("app_hosting_sa_runner", {
* project: "my-project-name",
* role: "roles/firebaseapphosting.computeRunner",
* member: serviceAccount.member,
* });
* ```
* ### Firebase App Hosting Backend Full
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* //## Include these blocks only once per project if you are starting from scratch ###
* const serviceAccount = new gcp.serviceaccount.Account("service_account", {
* project: "my-project-name",
* accountId: "firebase-app-hosting-compute",
* displayName: "Firebase App Hosting compute service account",
* createIgnoreAlreadyExists: true,
* });
* const fah = new gcp.projects.Service("fah", {
* project: "my-project-name",
* service: "firebaseapphosting.googleapis.com",
* });
* const example = new gcp.firebase.AppHostingBackend("example", {
* project: "my-project-name",
* location: "us-central1",
* backendId: "full",
* appId: "1:0000000000:web:674cde32020e16fbce9dbd",
* displayName: "My Backend",
* servingLocality: "GLOBAL_ACCESS",
* serviceAccount: serviceAccount.email,
* environment: "prod",
* annotations: {
* key: "value",
* },
* labels: {
* key: "value",
* },
* }, {
* dependsOn: [fah],
* });
* const appHostingSaDeveloperconnect = new gcp.projects.IAMMember("app_hosting_sa_developerconnect", {
* project: "my-project-name",
* role: "roles/developerconnect.readTokenAccessor",
* member: serviceAccount.member,
* });
* const appHostingSaAdminsdk = new gcp.projects.IAMMember("app_hosting_sa_adminsdk", {
* project: "my-project-name",
* role: "roles/firebase.sdkAdminServiceAgent",
* member: serviceAccount.member,
* });
* const appHostingSaRunner = new gcp.projects.IAMMember("app_hosting_sa_runner", {
* project: "my-project-name",
* role: "roles/firebaseapphosting.computeRunner",
* member: serviceAccount.member,
* });
* ```
* ### Firebase App Hosting Backend Github
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* //## Include these blocks only once per project if you are starting from scratch ###
* const devconnect_p4sa = new gcp.projects.ServiceIdentity("devconnect-p4sa", {
* project: "my-project-name",
* service: "developerconnect.googleapis.com",
* });
* const devconnect_secret = new gcp.projects.IAMMember("devconnect-secret", {
* project: "my-project-name",
* role: "roles/secretmanager.admin",
* member: devconnect_p4sa.member,
* });
* //##
* //## Include these blocks only once per Github account ###
* const my_connection = new gcp.developerconnect.Connection("my-connection", {
* project: "my-project-name",
* location: "us-central1",
* connectionId: "tf-test-connection-new",
* githubConfig: {
* githubApp: "FIREBASE",
* },
* }, {
* dependsOn: [devconnect_secret],
* });
* const my_repository = new gcp.developerconnect.GitRepositoryLink("my-repository", {
* project: "my-project-name",
* location: "us-central1",
* gitRepositoryLinkId: "my-repo",
* parentConnection: my_connection.connectionId,
* cloneUri: "https://github.com/myuser/myrepo.git",
* });
* const example = new gcp.firebase.AppHostingBackend("example", {
* project: "my-project-name",
* location: "us-central1",
* backendId: "my-backend-gh",
* appId: "1:0000000000:web:674cde32020e16fbce9dbd",
* displayName: "My Backend",
* servingLocality: "GLOBAL_ACCESS",
* serviceAccount: "firebase-app-hosting-compute@my-project-name.iam.gserviceaccount.com",
* environment: "prod",
* annotations: {
* key: "value",
* },
* labels: {
* key: "value",
* },
* codebase: {
* repository: my_repository.name,
* rootDirectory: "/",
* },
* });
* export const nextSteps = my_connection.installationStates;
* ```
*
* ## Import
*
* Backend can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/backends/{{backend_id}}`
*
* * `{{project}}/{{location}}/{{backend_id}}`
*
* * `{{location}}/{{backend_id}}`
*
* When using the `pulumi import` command, Backend can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:firebase/appHostingBackend:AppHostingBackend default projects/{{project}}/locations/{{location}}/backends/{{backend_id}}
* ```
*
* ```sh
* $ pulumi import gcp:firebase/appHostingBackend:AppHostingBackend default {{project}}/{{location}}/{{backend_id}}
* ```
*
* ```sh
* $ pulumi import gcp:firebase/appHostingBackend:AppHostingBackend default {{location}}/{{backend_id}}
* ```
*/
export declare class AppHostingBackend extends pulumi.CustomResource {
/**
* Get an existing AppHostingBackend 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?: AppHostingBackendState, opts?: pulumi.CustomResourceOptions): AppHostingBackend;
/**
* Returns true if the given object is an instance of AppHostingBackend. 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 AppHostingBackend;
/**
* Unstructured key value map that may be set by external tools to
* store and arbitrary metadata. They are not queryable and should be
* preserved when modifying objects.
* **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration.
* Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource.
*/
readonly annotations: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The [ID of a Web
* App](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects.webApps#WebApp.FIELDS.app_id)
* associated with the backend.
*/
readonly appId: pulumi.Output<string>;
/**
* Id of the backend. Also used as the service ID for Cloud Run, and as part
* of the default domain name.
*/
readonly backendId: pulumi.Output<string>;
/**
* The connection to an external source repository to watch for event-driven
* updates to the backend.
* Structure is documented below.
*/
readonly codebase: pulumi.Output<outputs.firebase.AppHostingBackendCodebase | undefined>;
/**
* Time at which the backend was created.
*/
readonly createTime: pulumi.Output<string>;
/**
* Time at which the backend was deleted.
*/
readonly deleteTime: pulumi.Output<string>;
/**
* Human-readable name. 63 character limit.
*/
readonly displayName: pulumi.Output<string | undefined>;
readonly effectiveAnnotations: pulumi.Output<{
[key: string]: string;
}>;
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
readonly effectiveLabels: pulumi.Output<{
[key: string]: string;
}>;
/**
* The environment name of the backend, used to load environment variables
* from environment specific configuration.
*/
readonly environment: pulumi.Output<string | undefined>;
/**
* Server-computed checksum based on other values; may be sent
* on update or delete to ensure operation is done on expected resource.
*/
readonly etag: pulumi.Output<string>;
/**
* Unstructured key value map that can be used to organize and categorize
* objects.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
readonly labels: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The canonical IDs of a Google Cloud location such as "us-east1".
*/
readonly location: pulumi.Output<string>;
/**
* A list of the resources managed by this backend.
* Structure is documented below.
*/
readonly managedResources: pulumi.Output<outputs.firebase.AppHostingBackendManagedResource[]>;
/**
* Identifier. The resource name of the backend.
* Format:
* `projects/{project}/locations/{locationId}/backends/{backendId}`.
*/
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>;
/**
* The combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
readonly pulumiLabels: pulumi.Output<{
[key: string]: string;
}>;
/**
* The name of the service account used for Cloud Build and Cloud Run.
* Should have the role roles/firebaseapphosting.computeRunner
* or equivalent permissions.
*/
readonly serviceAccount: pulumi.Output<string>;
/**
* Immutable. Specifies how App Hosting will serve the content for this backend. It will
* either be contained to a single region (REGIONAL_STRICT) or allowed to use
* App Hosting's global-replicated serving infrastructure (GLOBAL_ACCESS).
* Possible values are: `REGIONAL_STRICT`, `GLOBAL_ACCESS`.
*/
readonly servingLocality: pulumi.Output<string>;
/**
* System-assigned, unique identifier.
*/
readonly uid: pulumi.Output<string>;
/**
* Time at which the backend was last updated.
*/
readonly updateTime: pulumi.Output<string>;
/**
* The primary URI to communicate with the backend.
*/
readonly uri: pulumi.Output<string>;
/**
* Create a AppHostingBackend 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: AppHostingBackendArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering AppHostingBackend resources.
*/
export interface AppHostingBackendState {
/**
* Unstructured key value map that may be set by external tools to
* store and arbitrary metadata. They are not queryable and should be
* preserved when modifying objects.
* **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration.
* Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource.
*/
annotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The [ID of a Web
* App](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects.webApps#WebApp.FIELDS.app_id)
* associated with the backend.
*/
appId?: pulumi.Input<string>;
/**
* Id of the backend. Also used as the service ID for Cloud Run, and as part
* of the default domain name.
*/
backendId?: pulumi.Input<string>;
/**
* The connection to an external source repository to watch for event-driven
* updates to the backend.
* Structure is documented below.
*/
codebase?: pulumi.Input<inputs.firebase.AppHostingBackendCodebase>;
/**
* Time at which the backend was created.
*/
createTime?: pulumi.Input<string>;
/**
* Time at which the backend was deleted.
*/
deleteTime?: pulumi.Input<string>;
/**
* Human-readable name. 63 character limit.
*/
displayName?: pulumi.Input<string>;
effectiveAnnotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
*/
effectiveLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The environment name of the backend, used to load environment variables
* from environment specific configuration.
*/
environment?: pulumi.Input<string>;
/**
* Server-computed checksum based on other values; may be sent
* on update or delete to ensure operation is done on expected resource.
*/
etag?: pulumi.Input<string>;
/**
* Unstructured key value map that can be used to organize and categorize
* objects.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The canonical IDs of a Google Cloud location such as "us-east1".
*/
location?: pulumi.Input<string>;
/**
* A list of the resources managed by this backend.
* Structure is documented below.
*/
managedResources?: pulumi.Input<pulumi.Input<inputs.firebase.AppHostingBackendManagedResource>[]>;
/**
* Identifier. The resource name of the backend.
* Format:
* `projects/{project}/locations/{locationId}/backends/{backendId}`.
*/
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 combination of labels configured directly on the resource
* and default labels configured on the provider.
*/
pulumiLabels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The name of the service account used for Cloud Build and Cloud Run.
* Should have the role roles/firebaseapphosting.computeRunner
* or equivalent permissions.
*/
serviceAccount?: pulumi.Input<string>;
/**
* Immutable. Specifies how App Hosting will serve the content for this backend. It will
* either be contained to a single region (REGIONAL_STRICT) or allowed to use
* App Hosting's global-replicated serving infrastructure (GLOBAL_ACCESS).
* Possible values are: `REGIONAL_STRICT`, `GLOBAL_ACCESS`.
*/
servingLocality?: pulumi.Input<string>;
/**
* System-assigned, unique identifier.
*/
uid?: pulumi.Input<string>;
/**
* Time at which the backend was last updated.
*/
updateTime?: pulumi.Input<string>;
/**
* The primary URI to communicate with the backend.
*/
uri?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a AppHostingBackend resource.
*/
export interface AppHostingBackendArgs {
/**
* Unstructured key value map that may be set by external tools to
* store and arbitrary metadata. They are not queryable and should be
* preserved when modifying objects.
* **Note**: This field is non-authoritative, and will only manage the annotations present in your configuration.
* Please refer to the field `effectiveAnnotations` for all of the annotations present on the resource.
*/
annotations?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The [ID of a Web
* App](https://firebase.google.com/docs/reference/firebase-management/rest/v1beta1/projects.webApps#WebApp.FIELDS.app_id)
* associated with the backend.
*/
appId: pulumi.Input<string>;
/**
* Id of the backend. Also used as the service ID for Cloud Run, and as part
* of the default domain name.
*/
backendId: pulumi.Input<string>;
/**
* The connection to an external source repository to watch for event-driven
* updates to the backend.
* Structure is documented below.
*/
codebase?: pulumi.Input<inputs.firebase.AppHostingBackendCodebase>;
/**
* Human-readable name. 63 character limit.
*/
displayName?: pulumi.Input<string>;
/**
* The environment name of the backend, used to load environment variables
* from environment specific configuration.
*/
environment?: pulumi.Input<string>;
/**
* Unstructured key value map that can be used to organize and categorize
* objects.
* **Note**: This field is non-authoritative, and will only manage the labels present in your configuration.
* Please refer to the field `effectiveLabels` for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The canonical IDs of a Google Cloud location such as "us-east1".
*/
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>;
/**
* The name of the service account used for Cloud Build and Cloud Run.
* Should have the role roles/firebaseapphosting.computeRunner
* or equivalent permissions.
*/
serviceAccount: pulumi.Input<string>;
/**
* Immutable. Specifies how App Hosting will serve the content for this backend. It will
* either be contained to a single region (REGIONAL_STRICT) or allowed to use
* App Hosting's global-replicated serving infrastructure (GLOBAL_ACCESS).
* Possible values are: `REGIONAL_STRICT`, `GLOBAL_ACCESS`.
*/
servingLocality: pulumi.Input<string>;
}