diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 58ca5b3..904578c 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -44,6 +44,8 @@ jobs: shell: bash lock-diff: name: Lock diff + # package-diff posts PR comments via github.event.pull_request.comments_url (missing on push). + if: github.event_name == 'pull_request' runs-on: ubuntu-latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/dist/fargate.d.ts b/dist/fargate.d.ts index 1290032..68cbf55 100644 --- a/dist/fargate.d.ts +++ b/dist/fargate.d.ts @@ -29,6 +29,8 @@ export type EnvFactory = (stack: StackConfig, defaults: Record) interface FargateServiceProps extends cdk.NestedStackProps { subDomainIncludingDot?: string; healthCheckPath?: string; + /** Container port the task listens on (ALB target group + task port mapping). Default 80. */ + containerPort?: number; /** * Set to "default" to run a default image instead of * using the provided repository diff --git a/dist/fargate.js b/dist/fargate.js index a396a6b..cd68084 100644 --- a/dist/fargate.js +++ b/dist/fargate.js @@ -55,7 +55,7 @@ const DEFAULT_VERSION = 'default'; class FargateService extends cdk.NestedStack { constructor(scope, id, props) { super(scope, id, props); - const { healthCheckPath = '/health-check', imageVersion = DEFAULT_VERSION, subDomainIncludingDot = '', stack, cluster, certificate, zone, repository, taskConfiguration, loadBalancerIngress = load_balancer_ingress_1.LOAD_BALANCER_INGRESS.Open, loadBalancerCidrs, } = props; + const { healthCheckPath = '/health-check', containerPort = 80, imageVersion = DEFAULT_VERSION, subDomainIncludingDot = '', stack, cluster, certificate, zone, repository, taskConfiguration, loadBalancerIngress = load_balancer_ingress_1.LOAD_BALANCER_INGRESS.Open, loadBalancerCidrs, } = props; const allowedCidrs = (0, load_balancer_ingress_1.resolveLoadBalancerCidrs)(loadBalancerIngress, loadBalancerCidrs); // Compile secrets into list of mapped ecs.Secrets const secrets = {}; @@ -86,6 +86,7 @@ class FargateService extends cdk.NestedStack { desiredCount, taskImageOptions: { image, + containerPort, environment: taskConfiguration?.environment || {}, secrets, }, diff --git a/src/fargate.ts b/src/fargate.ts index 512aa37..52acb66 100644 --- a/src/fargate.ts +++ b/src/fargate.ts @@ -52,6 +52,8 @@ export type EnvFactory = ( interface FargateServiceProps extends cdk.NestedStackProps { subDomainIncludingDot?: string healthCheckPath?: string + /** Container port the task listens on (ALB target group + task port mapping). Default 80. */ + containerPort?: number /** * Set to "default" to run a default image instead of * using the provided repository @@ -88,6 +90,7 @@ export class FargateService extends cdk.NestedStack { const { healthCheckPath = '/health-check', + containerPort = 80, imageVersion = DEFAULT_VERSION, subDomainIncludingDot = '', stack, @@ -145,6 +148,7 @@ export class FargateService extends cdk.NestedStack { desiredCount, taskImageOptions: { image, + containerPort, environment: taskConfiguration?.environment || {}, secrets, },