Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FargatePlatformVersion not getting respected in StepFunctions when using CDK #8610

Closed
yashwanthkp opened this issue Jun 17, 2020 · 5 comments · Fixed by #8451
Closed

FargatePlatformVersion not getting respected in StepFunctions when using CDK #8610

yashwanthkp opened this issue Jun 17, 2020 · 5 comments · Fixed by #8451
Assignees
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions bug This issue is a bug. effort/small Small work item – less than a day of effort in-progress This issue is being actively worked on. p1

Comments

@yashwanthkp
Copy link

yashwanthkp commented Jun 17, 2020

FargatePlatformVersion not getting respected in StepFunctions when using CDK

Reproduction Steps

I have a fargate task as a step in my step-function with the below code which tries to start the task on FargatePlatform version 1.4.

return new sfn.Task(app, props.id, {
    task: new tasks.RunEcsFargateTask({
        cluster: props.cluster,
        taskDefinition: props.taskDef,
        subnets: props.cgpVpc.selectSubnets({subnetType: SubnetType.PRIVATE}),
        integrationPattern: props.integrationPattern,
        containerOverrides: [
            {
                containerName: "containerId",
                environment: getSfnEnvValues(props.envValueKeys)
            }],
        platformVersion: FargatePlatformVersion.VERSION1_4
    }),
    resultPath: props.resultPath,
    timeout: timeout
});

After I run cdk deploy, I end up getting the below ASL code

"TaskRun": {
      "Next": "X",
      "Parameters": {
        "Cluster": "arn: aws: ecs: us-west-2:...",
        "TaskDefinition": "arn: aws: ecs: us-west-2: ....",
        "NetworkConfiguration": {
          "AwsvpcConfiguration": {
            "Subnets": [
              "subnet-...."
            ],
            "SecurityGroups": [
              "sg-...."
            ]
          }
        },
        "Overrides": {
          "ContainerOverrides": [
            {
              "Name": "Container",
              "Environment": [
                {
                  "Name": "STAGE",
                  "Value": "devo"
                }
              ]
            }
          ]
        },
        "LaunchType": "FARGATE"
      },
      "Type": "Task",
      "Resource": "arn: aws: states: : : ecs: runTask.waitForTaskToken",
      "TimeoutSeconds": 900
    },

I was expecting a new line "PlatformVersion": "1.4.0" in the generated ASL.

Error Log

There are no errors on cdk deploy. However the stepfunction created does not have "PlatformVersion": "1.4.0" override in ASL.

Environment

  • CLI Version :
  • Framework Version: : 1.39
  • Node.js Version: 12.x
  • **OS : Linux
  • Language (Version): Typescript: 3.6.4

Other

NA


This is 🐛 Bug Report

@yashwanthkp yashwanthkp added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 17, 2020
@SomayaB SomayaB added the @aws-cdk/aws-stepfunctions Related to AWS StepFunctions label Jun 18, 2020
@shivlaks shivlaks added p1 effort/small Small work item – less than a day of effort labels Jun 18, 2020
@shivlaks
Copy link
Contributor

@yashwanthkp thanks for reporting the issue and detailed repro steps. I'd expect the output to include the fargate version as well. I'll investigate to see why that property is not being honoured and provide an update.

@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Jun 18, 2020
@yashwanthkp
Copy link
Author

@shivlaks

Thanks for the response!

Is there a tentative date for the fix for this?

@shivlaks
Copy link
Contributor

@yashwanthkp added a commit to #8451 that honors the fargate platform version. Note that this is the newer style of calling service integrations with Step Functions, which we are aligning so we can push Step Functions towards stable and drop the experimental tag

@yashwanthkp
Copy link
Author

yashwanthkp commented Jun 23, 2020

@shivlaks Thanks for the response! Which version of CDK will the above change be rolled out in?

@shivlaks
Copy link
Contributor

@yashwanthkp there's still some feedback to work through before it'll be merged and i'm currently on it.
After it's merged, it'll be included in the next released version of the CDK. you can follow release notes to keep an eye out for the new ECS service integration with Step Functions when it pops up.

@shivlaks shivlaks added the in-progress This issue is being actively worked on. label Jun 23, 2020
@mergify mergify bot closed this as completed in #8451 Jun 30, 2020
mergify bot pushed a commit that referenced this issue Jun 30, 2020
)

Replacement for the current implementation of `ECS` service integration.
Merges state and service integration properties and represents them as a
construct.

The notable differences from the current implementation are:
* single implementation class`runTask` with an added `launchTarget` required
property where the properties specific to the launch type are specified
* linter disable of `ref-via-interface` as we need to use `TaskDefinition`
because properties that are not known for imported task definitions are required
* older implementations have been marked deprecated with direction to the
replacement.

Left all of the unit tests (except fargate platform version which was not
previously honored) and integ test expectations verbatim to ensure that
we have not lost fidelity. 

BREAKING CHANGE:
* `containerName` is not supported as an override anymore and has been replaced by `containerDefinition`

Closes #8610


----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-stepfunctions Related to AWS StepFunctions bug This issue is a bug. effort/small Small work item – less than a day of effort in-progress This issue is being actively worked on. p1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants