Hi :wave:, I'm new to Pulumi and trying to deploy ...
# aws
t
Hi 👋, I'm new to Pulumi and trying to deploy a simple docker container to Fargate. 1. I'm building a docker image using
awsx.ecs.Image.fromPath
how can I pass environment variables to the docker build command? 2. Is it possible to map EFS volume to the docker container for persistency using Pulumi? This is my current scripts (following the Fargate tutorial)
Copy code
import * as awsx from '@pulumi/awsx';
import * as pulumi from '@pulumi/pulumi';

const listener = new awsx.elasticloadbalancingv2.NetworkListener('example', { port: 443 });

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const service = new awsx.ecs.FargateService('example', {
  taskDefinitionArgs: {
    containers: {
      example: {
        image: awsx.ecs.Image.fromPath('example', '/Source/example'),
        memory: 2048,
        portMappings: [listener],
        environment: [
          {
            name: 'ENV',
            value: 'CLOUD',
          },
        ],
      },
    },
  },
});

export const frontendURL = pulumi.interpolate`http://${listener.endpoint.hostname}/`;