-
Notifications
You must be signed in to change notification settings - Fork 90
refactor: Updated EKS integration to use integration_pattern #177
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice change! all the locations where a service integration pattern is now accepted also need a test case exercising an "unsupported" integration pattern.
Co-authored-by: Shiv Lakshminarayan <[email protected]>
…ation_pattern arg to EksCallStep
Thanks for the review @shivlaks !
Added the unite tests for unsupported I also added the |
Comments were addressed and suggested changes were added with last commits
|
||
@patch.object(boto3.session.Session, 'region_name', 'us-east-1') | ||
def test_eks_create_cluster_step_creation_wait_for_task_token_raises_error(): | ||
error_message = re.escape(f"Integration Pattern ({IntegrationPattern.WaitForTaskToken.name}) is not supported for this step - " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was debating on adding a method in test/unit/utils to build the error message to avoid code repetition, but found that building the error message in each test improves readability. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i like having it in the test for readability so don't have any objections to what you've gone with.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 🚀
Description
Update Amazon EKS service integration to use
integration_pattern
input instead orwait_for_completion
flag.Fixes #(issue) - N/A
Why is the change necessary?
This change is necessary for consistency with the new service integration implementation pattern introduced in commit (Add support for Nested Step Functions) that uses the
integration_pattern
arg in the step constructor to build the resource.Support for Amazon EKS service integration was added in this commit, but not released yet.
A later commit (Add support for Nested Step Functions) introduced a new implementation pattern using the
IntegrationPattern
enum as input to construct the step instead of thewait_for_completion
flag. (See PR for more detail on rationale behind the implementation).Solution
Replace the
wait_for_completion
flag withintegration_pattern
arg for the step construction:The
IntegrationPattern
is used to build theResource
arn as follow:See Service Integration Patterns for more details
Apply changes to the following steps:
arn:aws:states:::eks:runJob
arn:aws:states:::eks:runJob.sync
arn: arn:aws:states:::eks:call
rn:aws:states:::eks:createCluster
arn:aws:states:::eks:createCluster.sync
arn:aws:states:::eks:deleteCluster
arn:aws:states:::eks:deleteCluster.sync
arn:aws:states:::eks:createFargateProfile
arn:aws:states:::eks:createFargateProfile.sync
arn:aws:states:::eks:deleteFargateProfile
arn:aws:states:::eks:deleteFargateProfile.sync
arn:aws:states:::eks:createNodegroup
arn:aws:states:::eks:createNodegroup.sync
arn:aws:states:::eks:deleteNodegroup
arn:aws:states:::eks:deleteNodegroup.sync
Normally, replacing a constructor argument would be a breaking change, but since we have not released support for Amazon EKS service integration yet, it is acceptable to do so. After next release, it making such changes will be considered as not being backward compatible.
Testing
Manual tests
EKS cluster management
Created step machine to test several eks steps (based on the
Manage EKS cluster
sample project):Fargate profile creation/deletion test
Using an existing cluster <cluster_name>, create Fargate profile and delete it once profile creation succeeds
Pull Request Checklist
Please check all boxes (including N/A items)
Testing
Documentation
Title and description
Fixes #xxx
- N/ABy submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.