How to use the @aws-cdk/aws-ecs-patterns.LoadBalancedFargateService function in @aws-cdk/aws-ecs-patterns

To help you get started, we’ve selected a few @aws-cdk/aws-ecs-patterns 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 aws-samples / aws-cdk-changelogs-demo / changelogs-md.js View on Github external
constructor(parent, id, props) {
    super(parent, id, props);

    const broadcast = new ecsPatterns.LoadBalancedFargateService(this, 'Broadcast', {
      image: ecs.ContainerImage.fromAsset('./app/socket-broadcast'),
      publicTasks: true,
      cluster: props.cluster,
      cpu: 256,
      memoryLimitMiB: 512,
      desiredCount: 1,
      environment: {
        REDIS_HOST: props.redis.cluster.attrRedisEndpointAddress,
        REDIS_PORT: props.redis.cluster.attrRedisEndpointPort
      },
      createLogs: true
    });

    // Grant the broadcast service networking access to Redis
    broadcast.service.connections.allowToDefaultPort(props.redis);

@aws-cdk/aws-ecs-patterns

The CDK Construct Library for AWS::ECS

Apache-2.0
Latest version published 1 year ago

Package Health Score

65 / 100
Full package analysis