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

Updates the Lambda function that creates the service-linked role for … #1053

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jaehyi-aws
Copy link
Contributor

@jaehyi-aws jaehyi-aws commented Dec 5, 2024

Issue #, if available:*

Description of changes:*

The Timeout for the Lambda function was 15 seconds, which would not have been enough for the function to complete execution because of 30-second sleep in the code.

  1. Increases the timeout to 90 seconds.
  2. Adds ServiceTimeout to the custom resource to match the function timeout.
  3. Modularizes the code within the function for enhanced readability.
  4. Uses ListEnrollmentStatuses, instead of GetPreferences, to check if an account is enrolled in COH.
  5. Uses standard mode for retries, with the max attempts capped to 5.
  6. Removes unneeded permissions from the function's execution role

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Comment on lines 738 to 740
waiter = iam_client.get_waiter("role_exists")
waiter.wait(RoleName=role_name)
time.sleep(10) # Additional wait time, just in case
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaehyi-aws jaehyi-aws force-pushed the update-lambda-function-create-slr branch from 33367d4 to 3dbd5b5 Compare December 5, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants