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

Add CreateNotebookInstance shortcut #7681

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lithiumoxide
Copy link

This adds a CloudTrail event shortcut for the CreateNotebookInstance action for Sagemaker Notebooks.

While experimenting with policies to manage Sagemaker resources, I used the following in a policy for mode: cloudtrail:

      events:
        - source: sagemaker.amazonaws.com
          event: CreateNotebookInstance
          ids: 'requestParameters.notebookInstanceName'

Creating a Notebook creates an event in CloudTrail, which contains the following:

    "requestParameters": {
        "notebookInstanceName": "c7n-conor-test-5",
        .....
    },

My Cloud Custodian policy successfully finds the resource, outputting this to CloudWatch logs:

[INFO]	2022-08-24T09:53:45.039Z	157f4a60-671e-4a08-9f1e-8e7587297905	Found resource ids:['c7n-conor-test-5']

@linux-foundation-easycla
Copy link

CLA Missing ID CLA Not Signed

@thisisshi
Copy link
Member

Hi @lithiumoxide thanks for the contribution, at this time we don't typically add additional shortcuts unless it's something that's widely used, for instance the last short cut that was added was 4 years ago for lambda CreateFunction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants