Deploy a container with a DBC-built image on AWS Fargate
An example that builds a Docker image in DBC and deploys a container to AWS Fargate.
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set aws-ts-containers-dockerbuildcloudcd pulumi-examples/aws-ts-containers-dockerbuildcloudDeploys an AWS Fargate service. The service uses a Docker image that is built with Docker Build Cloud (DBC). The image is pushed to AWS ECR. This template prompts the user for an existing DBC builder.
Last revision: May 2024.
This Pulumi example is also written as a template. If you prefer, you can copy it with pulumi new instead of cloning the repo:
pulumi new https://github.com/pulumi/examples/tree/master/aws-ts-containers-dockerbuildcloudPrerequisites#
- Install Pulumi
- Configure AWS credentials
- Install Node.js
- A Docker Build Cloud (DBC) builder — you must complete the DBC builder setup steps
- Docker Desktop / CLI
- Recommended: a Pulumi Cloud account
Deploying the example#
-
Create a new stack:
Terminal window pulumi stack init dev -
Set the AWS region to deploy into:
Terminal window pulumi config set aws:region us-west-2 -
Set your existing Docker Build Cloud builder (e.g.,
cloud-pulumi-my-cool-builder):Terminal window pulumi config set builder <your-dbc-builder> -
Install dependencies:
Terminal window npm install -
Deploy the stack:
Terminal window pulumi up -
Confirm the service is up and running:
Terminal window curl $(pulumi stack output url)
Cleaning up#
Once you’re finished experimenting, destroy your stack and remove it to avoid incurring further charges:
pulumi destroypulumi stack rm