Skip to content
This repository has been archived by the owner on May 19, 2023. It is now read-only.

Commit

Permalink
feat: Add support for domain
Browse files Browse the repository at this point in the history
  • Loading branch information
simenandre committed Jan 22, 2021
1 parent f082aa9 commit 23454e9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 11 deletions.
30 changes: 19 additions & 11 deletions src/components/cloud-run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export interface CloudRunConfig {
*/
readonly image: pulumi.Input<string>;

/**
* domain
*/
readonly domain?: pulumi.Input<string>;

/**
* The location of the cloud run instance. eg us-central1
*/
Expand Down Expand Up @@ -71,6 +76,7 @@ export class CloudRun extends pulumi.ComponentResource {
containerConcurrency = 80,
maxScale = 5,
minScale = 0,
domain,
...config
} = args;

Expand Down Expand Up @@ -177,18 +183,20 @@ export class CloudRun extends pulumi.ComponentResource {

const project = gcp.organizations.getProject(undefined, { parent: this });

this.domainMapping = new gcp.cloudrun.DomainMapping(
name,
{
location: config.location,
metadata: {
namespace: project.then(p => p.name),
if (domain) {
this.domainMapping = new gcp.cloudrun.DomainMapping(
name,
{
location: config.location,
metadata: {
namespace: project.then(p => p.name),
},
name: domain,
spec: { routeName: this.service.name },
},
name: '',
spec: { routeName: this.service.name },
},
{ parent: this },
);
{ parent: this },
);
}

this.cloudRunIamMember = new gcp.cloudrun.IamMember(
name,
Expand Down
1 change: 1 addition & 0 deletions src/wordpress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export class Wordpress extends pulumi.ComponentResource {
{
image: this.gcrDocker.image.imageName,
location,
domain,
dbEnvironmentPrefix: envPrefix[preset],
databaseSettings: {
connectionName: this.database.database.instance,
Expand Down

0 comments on commit 23454e9

Please sign in to comment.