Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/packages/gcp/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ function createLoadBalancer(
* Deploys static files to GCS bucket with a backend bucket (for use in load balancer)
*/
export interface StaticWebAppArgs {
/**
* An optional description of this resource
*/
description?: pulumi.Input<string>;

/**
* Path to the directory containing static files
*/
Expand Down Expand Up @@ -497,6 +502,11 @@ export class StaticWebApp extends pulumi.ComponentResource {
* Configuration for Cloud Run backend service
*/
export interface CloudRunServiceArgs {
/**
* An optional description of this resource
*/
description?: pulumi.Input<string>;

/**
* GCP project and common options
*/
Expand Down Expand Up @@ -1228,6 +1238,11 @@ export class CloudRunService extends pulumi.ComponentResource {
* Combines a static frontend with a Cloud Run backend
*/
export interface FullStackAppArgs {
/**
* An optional description of this resource
*/
description?: pulumi.Input<string>;

/**
* Load balancer configuration (domain, SSL, IPs, DNS)
*/
Expand Down
20 changes: 20 additions & 0 deletions tests/integration/cloudrun-with-db.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { describe, it, expect, afterAll } from 'vitest';
import * as pulumi from '@pulumi/pulumi';
import type { CloudRunServiceArgs } from '../../src/packages/gcp/apps';
import { deployStack, destroyStack, type StackOutputs } from '../helpers/pulumi';

describe('CloudRunService with Database', function() {
Expand Down Expand Up @@ -54,3 +56,21 @@ describe('CloudRunService with Database', function() {
await destroyStack('examples/cloudrun-with-db', stackName);
}, 1_800_000); // 30 min timeout for destroy (Cloud SQL teardown is slow)
});

describe('CloudRunServiceArgs description field', () => {
const baseArgs = {
gcp: { project: 'my-project' },
region: 'us-central1' as const,
image: { uri: 'gcr.io/my-project/my-image:latest' }
};

it('accepts pulumi.Input<string> and pulumi.Output<string>', () => {
const withInput: CloudRunServiceArgs = { ...baseArgs, description: 'my service' };
const withOutput: CloudRunServiceArgs = { ...baseArgs, description: pulumi.output('my service') };
const withoutDescription: CloudRunServiceArgs = { ...baseArgs };

expect(withInput.description).toBeDefined();
expect(withOutput.description).toBeDefined();
expect(withoutDescription.description).toBeUndefined();
});
});
24 changes: 24 additions & 0 deletions tests/integration/fullstack-app.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { describe, it, expect, afterAll } from 'vitest';
import * as pulumi from '@pulumi/pulumi';
import type { FullStackAppArgs } from '../../src/packages/gcp/apps';
import { deployStack, destroyStack, fetchWithRetry, type StackOutputs } from '../helpers/pulumi';

const domain = process.env.TEST_DOMAIN || 'fullstack.pulumi-components-test-zone.test.keeta.com';
Expand Down Expand Up @@ -101,3 +103,25 @@ describe('FullStackApp', function() {
await destroyStack('examples/fullstack-app', stackName);
}, 1_800_000);
});

describe('FullStackAppArgs description field', () => {
const baseArgs = {
loadBalancer: { domain: 'app.example.com', ssl: { domains: ['app.example.com'] } },
frontend: { staticFilesPath: './dist' },
backend: {
gcp: { project: 'my-project' },
region: 'us-central1' as const,
image: { uri: 'gcr.io/my-project/my-image:latest' }
}
};

it('accepts pulumi.Input<string> and pulumi.Output<string>', () => {
const withInput: FullStackAppArgs = { ...baseArgs, description: 'my app' };
const withOutput: FullStackAppArgs = { ...baseArgs, description: pulumi.output('my app') };
const withoutDescription: FullStackAppArgs = { ...baseArgs };

expect(withInput.description).toBeDefined();
expect(withOutput.description).toBeDefined();
expect(withoutDescription.description).toBeUndefined();
});
});
14 changes: 14 additions & 0 deletions tests/integration/static-webapp.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { describe, it, expect, afterAll } from 'vitest';
import * as pulumi from '@pulumi/pulumi';
import type { StaticWebAppArgs } from '../../src/packages/gcp/apps';
import { deployStack, destroyStack, type StackOutputs } from '../helpers/pulumi';

describe('StaticWebApp', function() {
Expand Down Expand Up @@ -30,3 +32,15 @@ describe('StaticWebApp', function() {
await destroyStack('examples/static-webapp', stackName);
}, 1_800_000); // 30 min timeout for destroy
});

describe('StaticWebAppArgs description field', () => {
it('accepts pulumi.Input<string> and pulumi.Output<string>', () => {
const withInput: StaticWebAppArgs = { staticFilesPath: './dist', description: 'my app' };
const withOutput: StaticWebAppArgs = { staticFilesPath: './dist', description: pulumi.output('my app') };
const withoutDescription: StaticWebAppArgs = { staticFilesPath: './dist' };

expect(withInput.description).toBeDefined();
expect(withOutput.description).toBeDefined();
expect(withoutDescription.description).toBeUndefined();
});
});
Loading