How to use the @pulumi/awsx.ecr function in @pulumi/awsx

To help you get started, we’ve selected a few @pulumi/awsx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pulumi / kubernetes-guides / aws / 06-apps / build-deploy-container / index.ts View on Github external
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

import * as awsx from "@pulumi/awsx";
import * as k8s from "@pulumi/kubernetes";
import * as kx from "@pulumi/kubernetesx";
import { config } from "./config";

// Create a repository.
const repo = new awsx.ecr.Repository("my-repo");

// Build a Docker image from a local Dockerfile context in the
// './node-app' directory, and push it to the registry.
const customImage = "node-app";
const appImage = repo.buildAndPushImage(`./${customImage}`);

// Create a k8s provider.
const provider = new k8s.Provider("provider", {
    kubeconfig: config.kubeconfig,
    namespace: config.appsNamespaceName,
});

// Create a Deployment of the built container.
const appLabels = { app: customImage };
const appDeployment = new k8s.apps.v1.Deployment("app", {
    spec: {
github ever-co / gauzy-pulumi / src / docker-images.ts View on Github external
const webappRepoName = `gauzy/webapp-${environment.toLowerCase()}`;

	const repositoryWebapp = new aws.ecr.Repository(webappRepoName, {
		name: webappRepoName
	});

	let apiImage;

	// Build and publish a Docker image to a private ECR registry for API.
	if (environment !== Environment.Prod) {
		apiImage = awsx.ecs.Image.fromDockerBuild(repositoryApi, {
			context: config.dockerContextPath,
			dockerfile: config.dockerAPIFile
		});
	} else {
		apiImage = awsx.ecr.buildAndPushImage(
			apiRepoName,
			{
				context: config.dockerContextPath,
				dockerfile: config.dockerAPIFile
			},
			{ repository: repositoryApi }
		);
	}

	let webappImage;

	// Build and publish a Docker image to a private ECR registry for Web App.
	if (environment !== Environment.Prod) {
		webappImage = awsx.ecs.Image.fromDockerBuild(repositoryWebapp, {
			context: config.dockerContextPath,
			dockerfile: config.dockerWebappFile

@pulumi/awsx

[![Actions Status](https://github.com/pulumi/pulumi-awsx/workflows/master/badge.svg)](https://github.com/pulumi/pulumi-awsx/actions) [![Slack](http://www.pulumi.com/images/docs/badges/slack.svg)](https://slack.pulumi.com) [![NPM version](https://badge.fur

Apache-2.0
Latest version published 17 days ago

Package Health Score

92 / 100
Full package analysis