aws.sagemaker-notebook

Filters

kms-key

Filter a resource by its associcated kms key and optionally the aliasname of the kms key by using ‘c7n:AliasName’

example

policies:
  - name: sagemaker-kms-key-filters
    resource: aws.sagemaker-notebook
    filters:
      - type: kms-key
        key: c7n:AliasName
        value: "^(alias/aws/sagemaker)"
        op: regex

  - name: sagemaker-endpoint-kms-key-filters
    resource: aws.sagemaker-endpoint-config
    filters:
      - type: kms-key
        key: c7n:AliasName
        value: "alias/aws/sagemaker"
properties:
  default:
    type: object
  key:
    type: string
  match-resource:
    type: boolean
  op:
    enum:
    - eq
    - equal
    - ne
    - not-equal
    - gt
    - greater-than
    - ge
    - gte
    - le
    - lte
    - lt
    - less-than
    - glob
    - regex
    - regex-case
    - in
    - ni
    - not-in
    - contains
    - difference
    - intersect
  operator:
    enum:
    - and
    - or
  type:
    enum:
    - kms-key
  value:
    oneOf:
    - type: array
    - type: string
    - type: boolean
    - type: number
    - type: 'null'
  value_from:
    additionalProperties: 'False'
    properties:
      expr:
        oneOf:
        - type: integer
        - type: string
      format:
        enum:
        - csv
        - json
        - txt
        - csv2dict
      url:
        type: string
    required:
    - url
    type: object
  value_regex:
    type: string
  value_type:
    enum:
    - age
    - integer
    - expiration
    - normalize
    - size
    - cidr
    - cidr_size
    - swap
    - resource_count
    - expr
    - unique_size
    - date
    - version
required:
- type

Permissions - kms:ListKeys

Actions

delete

Deletes sagemaker-notebook(s)

example

policies:
  - name: delete-sagemaker-notebook
    resource: sagemaker-notebook
    filters:
      - "tag:DeleteMe": present
    actions:
      - delete
properties:
  type:
    enum:
    - delete
required:
- type

Permissions - sagemaker:DeleteNotebookInstance

start

Start sagemaker-notebook(s)

example

policies:
  - name: start-sagemaker-notebook
    resource: sagemaker-notebook
    actions:
      - start
properties:
  type:
    enum:
    - start
required:
- type

Permissions - sagemaker:StartNotebookInstance

stop

Stop sagemaker-notebook(s)

example

policies:
  - name: stop-sagemaker-notebook
    resource: sagemaker-notebook
    filters:
      - "tag:DeleteMe": present
    actions:
      - stop
properties:
  type:
    enum:
    - stop
required:
- type

Permissions - sagemaker:StopNotebookInstance