Thread
#general
    c

    clean-salesclerk-32849

    1 week ago
    Hi, what's the best way to find the service IP from this code? I'm not using a LB because it's an internal API. :
    export const fargate = new awsx.ecs.FargateService(NAME, {
      cluster,
      taskDefinitionArgs: {
        containers: {
          mbankrlproxy: {
            image: image,
            memory: 512,
            portMappings: [{ containerPort: 80, hostPort: 80 }],
            environment: ENVIRONMENT,
          },
        },
      },
      desiredCount: 1,
    });
    The cluster->task->container is then given a Public and Private IP (I can see this on AWS consile). How do I access these IP's from the awsx API?
    b

    breezy-airplane-94478

    1 week ago
    not at my computer but usually with these kinds of problems, i export the entire resource at the end of my index.ts.
    then pulumi preview and see if i can trace down how to fetch the specific thing im looking for
    g

    green-stone-37839

    1 week ago
    @clean-salesclerk-32849 Unfortunately, public nor private IP addresses are a part of AWS
    DescribeServices
    endpoint response, so it's not available as you're trying to get above. I'm assuming this is because ENIs given to fargate services are likely to change.
    c

    clean-salesclerk-32849

    1 week ago
    @green-stone-37839 No problem. AWS isn't my wheelhouse. Is there another API to get them? Or can I assign a static IP? Just need to connect service to consumer. What's best practice?
    g

    green-stone-37839

    1 week ago
    The most common scenario is assigning the service to a load balancer and serving content from there. Who is the consumer in this case?
    c

    clean-salesclerk-32849

    1 week ago
    @green-stone-37839 it's an internal service for some other AWS EC2 instances. It shouldn't have an external IP, by maybe it was assigned one because I specified a public subnet.
    g

    green-stone-37839

    1 week ago
    internal or not, using the IP address of the service/task is going to cause problems for you when the service/task inevitably changes IP addresses.
    c

    clean-salesclerk-32849

    1 week ago
    Legit.
    g

    green-stone-37839

    1 week ago
    I'd suggest using a load balancer or ECS Service Discovery although load balancer is by far the simpler option.
    c

    clean-salesclerk-32849

    1 week ago
    Is there a way to specify the IP?
    Doesn't loadbalancer have a gateway to the internet? It's a singleton service that shouldn't scale.
    g

    green-stone-37839

    1 week ago
    an internal load balancer won't. Also, with Fargate you cannot assign a static or Elastic IP
    c

    clean-salesclerk-32849

    1 week ago
    Ok, sounds like a start. Thank you Phillip, have a great week!
    g

    green-stone-37839

    1 week ago
    you too!