AppHostingDomain class
A domain name that is associated with a backend.
Example Usage
Firebase App Hosting Domain Minimal
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const serviceAccount = new gcp.serviceaccount.Account("service_account", {
project: "my-project-name",
accountId: "sa-id",
displayName: "Firebase App Hosting compute service account",
createIgnoreAlreadyExists: true,
});
const exampleAppHostingBackend = new gcp.firebase.AppHostingBackend("example", {
project: "my-project-name",
location: "us-central1",
backendId: "domain-mini",
appId: "1:0000000000:web:674cde32020e16fbce9dbd",
servingLocality: "GLOBAL_ACCESS",
serviceAccount: serviceAccount.email,
});
const example = new gcp.firebase.AppHostingDomain("example", {
project: exampleAppHostingBackend.project,
location: exampleAppHostingBackend.location,
backend: exampleAppHostingBackend.backendId,
domainId: "example.com",
});
import pulumi
import pulumi_gcp as gcp
service_account = gcp.serviceaccount.Account("service_account",
project="my-project-name",
account_id="sa-id",
display_name="Firebase App Hosting compute service account",
create_ignore_already_exists=True)
example_app_hosting_backend = gcp.firebase.AppHostingBackend("example",
project="my-project-name",
location="us-central1",
backend_id="domain-mini",
app_id="1:0000000000:web:674cde32020e16fbce9dbd",
serving_locality="GLOBAL_ACCESS",
service_account=service_account.email)
example = gcp.firebase.AppHostingDomain("example",
project=example_app_hosting_backend.project,
location=example_app_hosting_backend.location,
backend=example_app_hosting_backend.backend_id,
domain_id="example.com")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var serviceAccount = new Gcp.ServiceAccount.Account("service_account", new()
{
Project = "my-project-name",
AccountId = "sa-id",
DisplayName = "Firebase App Hosting compute service account",
CreateIgnoreAlreadyExists = true,
});
var exampleAppHostingBackend = new Gcp.Firebase.AppHostingBackend("example", new()
{
Project = "my-project-name",
Location = "us-central1",
BackendId = "domain-mini",
AppId = "1:0000000000:web:674cde32020e16fbce9dbd",
ServingLocality = "GLOBAL_ACCESS",
ServiceAccount = serviceAccount.Email,
});
var example = new Gcp.Firebase.AppHostingDomain("example", new()
{
Project = exampleAppHostingBackend.Project,
Location = exampleAppHostingBackend.Location,
Backend = exampleAppHostingBackend.BackendId,
DomainId = "example.com",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/firebase"
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/serviceaccount"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
serviceAccount, err := serviceaccount.NewAccount(ctx, "service_account", &serviceaccount.AccountArgs{
Project: pulumi.String("my-project-name"),
AccountId: pulumi.String("sa-id"),
DisplayName: pulumi.String("Firebase App Hosting compute service account"),
CreateIgnoreAlreadyExists: pulumi.Bool(true),
})
if err != nil {
return err
}
exampleAppHostingBackend, err := firebase.NewAppHostingBackend(ctx, "example", &firebase.AppHostingBackendArgs{
Project: pulumi.String("my-project-name"),
Location: pulumi.String("us-central1"),
BackendId: pulumi.String("domain-mini"),
AppId: pulumi.String("1:0000000000:web:674cde32020e16fbce9dbd"),
ServingLocality: pulumi.String("GLOBAL_ACCESS"),
ServiceAccount: serviceAccount.Email,
})
if err != nil {
return err
}
_, err = firebase.NewAppHostingDomain(ctx, "example", &firebase.AppHostingDomainArgs{
Project: exampleAppHostingBackend.Project,
Location: exampleAppHostingBackend.Location,
Backend: exampleAppHostingBackend.BackendId,
DomainId: pulumi.String("example.com"),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_firebase_apphostingdomain" "example" {
project = gcp_firebase_apphostingbackend.example.project
location = gcp_firebase_apphostingbackend.example.location
backend = gcp_firebase_apphostingbackend.example.backend_id
domain_id = "example.com"
}
resource "gcp_firebase_apphostingbackend" "example" {
project = "my-project-name"
location = "us-central1"
backend_id = "domain-mini"
app_id = "1:0000000000:web:674cde32020e16fbce9dbd"
serving_locality = "GLOBAL_ACCESS"
service_account = gcp_serviceaccount_account.service_account.email
}
resource "gcp_serviceaccount_account" "service_account" {
project = "my-project-name"
account_id = "sa-id"
display_name = "Firebase App Hosting compute service account"
create_ignore_already_exists = true
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.serviceaccount.Account;
import com.pulumi.gcp.serviceaccount.AccountArgs;
import com.pulumi.gcp.firebase.AppHostingBackend;
import com.pulumi.gcp.firebase.AppHostingBackendArgs;
import com.pulumi.gcp.firebase.AppHostingDomain;
import com.pulumi.gcp.firebase.AppHostingDomainArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var serviceAccount = new Account("serviceAccount", AccountArgs.builder()
.project("my-project-name")
.accountId("sa-id")
.displayName("Firebase App Hosting compute service account")
.createIgnoreAlreadyExists(true)
.build());
var exampleAppHostingBackend = new AppHostingBackend("exampleAppHostingBackend", AppHostingBackendArgs.builder()
.project("my-project-name")
.location("us-central1")
.backendId("domain-mini")
.appId("1:0000000000:web:674cde32020e16fbce9dbd")
.servingLocality("GLOBAL_ACCESS")
.serviceAccount(serviceAccount.email())
.build());
var example = new AppHostingDomain("example", AppHostingDomainArgs.builder()
.project(exampleAppHostingBackend.project())
.location(exampleAppHostingBackend.location())
.backend(exampleAppHostingBackend.backendId())
.domainId("example.com")
.build());
}
}
resources:
example:
type: gcp:firebase:AppHostingDomain
properties:
project: ${exampleAppHostingBackend.project}
location: ${exampleAppHostingBackend.location}
backend: ${exampleAppHostingBackend.backendId}
domainId: example.com
exampleAppHostingBackend:
type: gcp:firebase:AppHostingBackend
name: example
properties:
project: my-project-name
location: us-central1
backendId: domain-mini
appId: 1:0000000000:web:674cde32020e16fbce9dbd
servingLocality: GLOBAL_ACCESS
serviceAccount: ${serviceAccount.email}
serviceAccount:
type: gcp:serviceaccount:Account
name: service_account
properties:
project: my-project-name
accountId: sa-id
displayName: Firebase App Hosting compute service account
createIgnoreAlreadyExists: true
Firebase App Hosting Domain Full
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const serviceAccount = new gcp.serviceaccount.Account("service_account", {
project: "my-project-name",
accountId: "sa-id",
displayName: "Firebase App Hosting compute service account",
createIgnoreAlreadyExists: true,
});
const exampleAppHostingBackend = new gcp.firebase.AppHostingBackend("example", {
project: "my-project-name",
location: "us-central1",
backendId: "domain-full",
appId: "1:0000000000:web:674cde32020e16fbce9dbd",
servingLocality: "GLOBAL_ACCESS",
serviceAccount: serviceAccount.email,
});
const example = new gcp.firebase.AppHostingDomain("example", {
project: exampleAppHostingBackend.project,
location: exampleAppHostingBackend.location,
backend: exampleAppHostingBackend.backendId,
domainId: "example.com",
serve: {
redirect: {
uri: "google.com",
status: "302",
},
},
});
import pulumi
import pulumi_gcp as gcp
service_account = gcp.serviceaccount.Account("service_account",
project="my-project-name",
account_id="sa-id",
display_name="Firebase App Hosting compute service account",
create_ignore_already_exists=True)
example_app_hosting_backend = gcp.firebase.AppHostingBackend("example",
project="my-project-name",
location="us-central1",
backend_id="domain-full",
app_id="1:0000000000:web:674cde32020e16fbce9dbd",
serving_locality="GLOBAL_ACCESS",
service_account=service_account.email)
example = gcp.firebase.AppHostingDomain("example",
project=example_app_hosting_backend.project,
location=example_app_hosting_backend.location,
backend=example_app_hosting_backend.backend_id,
domain_id="example.com",
serve={
"redirect": {
"uri": "google.com",
"status": "302",
},
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var serviceAccount = new Gcp.ServiceAccount.Account("service_account", new()
{
Project = "my-project-name",
AccountId = "sa-id",
DisplayName = "Firebase App Hosting compute service account",
CreateIgnoreAlreadyExists = true,
});
var exampleAppHostingBackend = new Gcp.Firebase.AppHostingBackend("example", new()
{
Project = "my-project-name",
Location = "us-central1",
BackendId = "domain-full",
AppId = "1:0000000000:web:674cde32020e16fbce9dbd",
ServingLocality = "GLOBAL_ACCESS",
ServiceAccount = serviceAccount.Email,
});
var example = new Gcp.Firebase.AppHostingDomain("example", new()
{
Project = exampleAppHostingBackend.Project,
Location = exampleAppHostingBackend.Location,
Backend = exampleAppHostingBackend.BackendId,
DomainId = "example.com",
Serve = new Gcp.Firebase.Inputs.AppHostingDomainServeArgs
{
Redirect = new Gcp.Firebase.Inputs.AppHostingDomainServeRedirectArgs
{
Uri = "google.com",
Status = "302",
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/firebase"
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/serviceaccount"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
serviceAccount, err := serviceaccount.NewAccount(ctx, "service_account", &serviceaccount.AccountArgs{
Project: pulumi.String("my-project-name"),
AccountId: pulumi.String("sa-id"),
DisplayName: pulumi.String("Firebase App Hosting compute service account"),
CreateIgnoreAlreadyExists: pulumi.Bool(true),
})
if err != nil {
return err
}
exampleAppHostingBackend, err := firebase.NewAppHostingBackend(ctx, "example", &firebase.AppHostingBackendArgs{
Project: pulumi.String("my-project-name"),
Location: pulumi.String("us-central1"),
BackendId: pulumi.String("domain-full"),
AppId: pulumi.String("1:0000000000:web:674cde32020e16fbce9dbd"),
ServingLocality: pulumi.String("GLOBAL_ACCESS"),
ServiceAccount: serviceAccount.Email,
})
if err != nil {
return err
}
_, err = firebase.NewAppHostingDomain(ctx, "example", &firebase.AppHostingDomainArgs{
Project: exampleAppHostingBackend.Project,
Location: exampleAppHostingBackend.Location,
Backend: exampleAppHostingBackend.BackendId,
DomainId: pulumi.String("example.com"),
Serve: &firebase.AppHostingDomainServeArgs{
Redirect: &firebase.AppHostingDomainServeRedirectArgs{
Uri: pulumi.String("google.com"),
Status: pulumi.String("302"),
},
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_firebase_apphostingdomain" "example" {
project = gcp_firebase_apphostingbackend.example.project
location = gcp_firebase_apphostingbackend.example.location
backend = gcp_firebase_apphostingbackend.example.backend_id
domain_id = "example.com"
serve = {
redirect = {
uri = "google.com"
status = "302"
}
}
}
resource "gcp_firebase_apphostingbackend" "example" {
project = "my-project-name"
location = "us-central1"
backend_id = "domain-full"
app_id = "1:0000000000:web:674cde32020e16fbce9dbd"
serving_locality = "GLOBAL_ACCESS"
service_account = gcp_serviceaccount_account.service_account.email
}
resource "gcp_serviceaccount_account" "service_account" {
project = "my-project-name"
account_id = "sa-id"
display_name = "Firebase App Hosting compute service account"
create_ignore_already_exists = true
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.serviceaccount.Account;
import com.pulumi.gcp.serviceaccount.AccountArgs;
import com.pulumi.gcp.firebase.AppHostingBackend;
import com.pulumi.gcp.firebase.AppHostingBackendArgs;
import com.pulumi.gcp.firebase.AppHostingDomain;
import com.pulumi.gcp.firebase.AppHostingDomainArgs;
import com.pulumi.gcp.firebase.inputs.AppHostingDomainServeArgs;
import com.pulumi.gcp.firebase.inputs.AppHostingDomainServeRedirectArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var serviceAccount = new Account("serviceAccount", AccountArgs.builder()
.project("my-project-name")
.accountId("sa-id")
.displayName("Firebase App Hosting compute service account")
.createIgnoreAlreadyExists(true)
.build());
var exampleAppHostingBackend = new AppHostingBackend("exampleAppHostingBackend", AppHostingBackendArgs.builder()
.project("my-project-name")
.location("us-central1")
.backendId("domain-full")
.appId("1:0000000000:web:674cde32020e16fbce9dbd")
.servingLocality("GLOBAL_ACCESS")
.serviceAccount(serviceAccount.email())
.build());
var example = new AppHostingDomain("example", AppHostingDomainArgs.builder()
.project(exampleAppHostingBackend.project())
.location(exampleAppHostingBackend.location())
.backend(exampleAppHostingBackend.backendId())
.domainId("example.com")
.serve(AppHostingDomainServeArgs.builder()
.redirect(AppHostingDomainServeRedirectArgs.builder()
.uri("google.com")
.status("302")
.build())
.build())
.build());
}
}
resources:
example:
type: gcp:firebase:AppHostingDomain
properties:
project: ${exampleAppHostingBackend.project}
location: ${exampleAppHostingBackend.location}
backend: ${exampleAppHostingBackend.backendId}
domainId: example.com
serve:
redirect:
uri: google.com
status: '302'
exampleAppHostingBackend:
type: gcp:firebase:AppHostingBackend
name: example
properties:
project: my-project-name
location: us-central1
backendId: domain-full
appId: 1:0000000000:web:674cde32020e16fbce9dbd
servingLocality: GLOBAL_ACCESS
serviceAccount: ${serviceAccount.email}
serviceAccount:
type: gcp:serviceaccount:Account
name: service_account
properties:
project: my-project-name
accountId: sa-id
displayName: Firebase App Hosting compute service account
createIgnoreAlreadyExists: true
Import
Domain can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/backends/{{backend}}/domains/{{domain_id}}{{project}}/{{location}}/{{backend}}/{{domain_id}}{{location}}/{{backend}}/{{domain_id}}
When using the pulumi import command, Domain can be imported using one of the formats above. For example:
$ pulumi import gcp:firebase/appHostingDomain:AppHostingDomain default projects/{{project}}/locations/{{location}}/backends/{{backend}}/domains/{{domain_id}}
$ pulumi import gcp:firebase/appHostingDomain:AppHostingDomain default {{project}}/{{location}}/{{backend}}/{{domain_id}}
$ pulumi import gcp:firebase/appHostingDomain:AppHostingDomain default {{location}}/{{backend}}/{{domain_id}}
Constructors
- AppHostingDomain(String name, {AppHostingDomainArgs? args, CustomResourceOptions? options})
-
Creates a new AppHostingDomain.
nameThe Pulumi resource name.argsArguments used to configure this AppHostingDomain. The set of arguments for AppHostingDomain.optionsResource options controlling this resource's behavior. - AppHostingDomain.reference(String urn)
- Creates a typed reference to an existing AppHostingDomain resource.
Properties
-
backend
↔ Output<
String> -
The ID of the Backend that this Domain is associated with
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
createTime
↔ Output<
String> -
Time at which the domain was created.
latefinal
-
customDomainStatuses
↔ Output<
List< AppHostingDomainCustomDomainStatus> > -
The status of a custom domain's linkage to the Backend.
Structure is documented below.
latefinal
-
deleteTime
↔ Output<
String> -
Time at which the domain was deleted.
latefinal
-
deletionPolicy
↔ 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.
latefinal
-
domainId
↔ Output<
String> -
Id of the domain to create.
Must be a valid domain name, such as "foo.com"
latefinal
-
etag
↔ Output<
String> -
Server-computed checksum based on other values; may be sent
on update or delete to ensure operation is done on expected resource.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
- isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
location
↔ Output<
String> -
The location of the Backend that this Domain is associated with
latefinal
-
name
↔ Output<
String> -
Identifier. The resource name of the domain, e.g.
projects/{project}/locations/{locationId}/backends/{backendId}/domains/{domainId}latefinal -
project
↔ Output<
String> -
The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
latefinal
-
purgeTime
↔ Output<
String> -
Time at which a soft-deleted domain will be purged, rendering in
permanently deleted.
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
serve
↔ Output<
AppHostingDomainServe?> -
The serving behavior of the domain. If specified, the domain will
serve content other than its Backend's live content.
Structure is documented below.
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
uid
↔ Output<
String> -
System-assigned, unique identifier.
latefinal
-
updateTime
↔ Output<
String> -
Time at which the domain was last updated.
latefinal
-
urn
↔ Output<
String> -
latefinalinherited
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
get(
String name, Input< String> id, {AppHostingDomainState? state, CustomResourceOptions? options}) → AppHostingDomain -
Gets an existing AppHostingDomain resource's state with the given
nameandid.