Resource: aws_sagemaker_workforce

Provides a SageMaker Workforce resource.

Example Usage

Cognito Usage

resource "aws_sagemaker_workforce" "example" {
  workforce_name = "example"

  cognito_config {
    client_id = aws_cognito_user_pool_client.example.id
    user_pool = aws_cognito_user_pool_domain.example.user_pool_id
  }
}

resource "aws_cognito_user_pool" "example" {
  name = "example"
}

resource "aws_cognito_user_pool_client" "example" {
  name            = "example"
  generate_secret = true
  user_pool_id    = aws_cognito_user_pool.example.id
}

resource "aws_cognito_user_pool_domain" "example" {
  domain       = "example"
  user_pool_id = aws_cognito_user_pool.example.id
}

Oidc Usage

resource "aws_sagemaker_workforce" "example" {
  workforce_name = "example"

  oidc_config {
    authorization_endpoint = "https://example.com"
    client_id              = "example"
    client_secret          = "example"
    issuer                 = "https://example.com"
    jwks_uri               = "https://example.com"
    logout_endpoint        = "https://example.com"
    token_endpoint         = "https://example.com"
    user_info_endpoint     = "https://example.com"
  }
}

Argument Reference

This resource supports the following arguments:

Cognito Config

Oidc Config

Source Ip Config

Workforce VPC Config

Attribute Reference

This resource exports the following attributes in addition to the arguments above:

Import

In Terraform v1.5.0 and later, use an import block to import SageMaker Workforces using the workforce_name. For example:

import {
  to = aws_sagemaker_workforce.example
  id = "example"
}

Using terraform import, import SageMaker Workforces using the workforce_name. For example:

% terraform import aws_sagemaker_workforce.example example