Qinjie
Qinjie

Reputation: 1928

Fargate Task - Public IP not Assigned

I used step functions to run a Fargate Task. I specified AssignPublicIp to ENABLED. But when I examined the the task, there is no public IP assigned. What else should I do to have a public IP?

enter image description here

    "Stage XXX": {
      "Type": "Task",
      "ResultPath": null,
      "Resource": "arn:aws:states:::ecs:runTask.sync",
      "Parameters": {
        "LaunchType": "FARGATE",
        "Cluster": "<EXPORTED_NAME_FARGATE_CLUSTER_ARN>",
        "TaskDefinition": "<EXPORTED_NAME_FARGATE_TASK_ARN>",
        "NetworkConfiguration": {
          "AwsvpcConfiguration": {
            "Subnets": ["<SUBNET-0>", "<SUBNET-1>"],
            "AssignPublicIp": "ENABLED"
          }
        },
        "Overrides": {
          "ContainerOverrides": [
            {
              "Name": "spinarak-process-fargate-task-container",
              "Environment": [
                {
                  "Name": "REDO_INFER",
                  "Value.$": "$.RedoInfer"
                },
                {
                  "Name": "REDO_EDM",
                  "Value.$": "$.RedoEdm"
                }
              ]
            }
          ]
        }
      },
      "Retry": [
        {
          "ErrorEquals": ["States.ALL"],
          "IntervalSeconds": 3,
          "MaxAttempts": 0,
          "BackoffRate": 1.5
        }
      ],
      "Catch": [
        {
          "ErrorEquals": ["States.ALL"],
          "ResultPath": "$.taskerror",
          "Next": "Publish Failure"
        }
      ],
      "Next": "Stage YYY"
    },

Upvotes: 0

Views: 426

Answers (1)

Qinjie
Qinjie

Reputation: 1928

Sorry. Just noticed that the public IP is removed after container is stopped. There is a public IP when container is still running.

enter image description here

enter image description here

Upvotes: 1

Related Questions