Skip to content

Commit b75557f

Browse files
author
manikanta-sadurla
committed
Merge pull request #2 from sourcefuse/feature/sagemaker
Sagemaker Terraform Module
1 parent 3a8e0d4 commit b75557f

File tree

1 file changed

+147
-0
lines changed
  • docs/arc-iac-docs/modules/terraform-aws-arc-sagemaker/docs/module-usage-guide

1 file changed

+147
-0
lines changed
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# Terraform AWS ARC Sagemaker Module Usage Guide
2+
3+
## Introduction
4+
5+
### Purpose of the Document
6+
7+
This document provides guidelines and instructions for users looking to implement the Terraform AWS SageMaker AI.
8+
9+
### Module Overview
10+
11+
A comprehensive Terraform module for creating and managing AWS SageMaker Studio resources — including domains, user profiles, models, endpoints, endpoint configurations, and ML pipelines. This module follows AWS and Terraform best practices, supports advanced customization, integrates seamlessly with IAM and VPC settings, and is designed to enable scalable, secure, and production-ready ML workflows.
12+
13+
### Prerequisites
14+
15+
Before using this module, ensure you have the following:
16+
17+
- AWS credentials configured.
18+
- Terraform installed.
19+
- A working knowledge of AWS VPC, All SageMaker services (Studio, Pipelines, Canvas, etc.), and Terraform concepts.
20+
21+
## Getting Started
22+
23+
### Module Source
24+
25+
To use the module in your Terraform configuration, include the following source block:
26+
27+
```hcl
28+
module "arc-sagemaker" {
29+
source = "sourcefuse/arc-sagemaker/aws"
30+
version = "0.0.1"
31+
name = "terraform-arc"
32+
create_endpoint_config = true
33+
create_model = true
34+
35+
36+
primary_container = {
37+
image = "683313688378.dkr.ecr.us-east-1.amazonaws.com/sagemaker-scikit-learn:1.0-1-cpu-py3"
38+
model_data_url = "s3://your-sagemaker-model-bucket-21-05-25/model/model.tar.gz"
39+
environment = {}
40+
}
41+
42+
production_variants = [
43+
{
44+
variant_name = "AllTraffic"
45+
initial_instance_count = 1
46+
instance_type = "ml.m5.large"
47+
initial_variant_weight = 1.0
48+
}
49+
]
50+
tags = module.tags.tags
51+
}
52+
```
53+
54+
Refer to the [Terraform Registry](https://registry.terraform.io/modules/sourcefuse/arc-sagemaker/aws/latest) for the latest version.
55+
56+
### Integration with Existing Terraform Configurations
57+
58+
Refer to the Terraform Registry for the latest version.
59+
60+
## Integration with Existing Terraform Configurations
61+
Integrate the module with your existing Terraform mono repo configuration, follow the steps below:
62+
63+
- Create a new folder in terraform/sagemaker named .
64+
- Create the required files, see the examples to base off of.
65+
- Configure with your backend:
66+
- Create the environment backend configuration file: config.<environment>.hcl
67+
- region: Where the backend resides
68+
- key: <working_directory>/terraform.tfstate
69+
- bucket: Bucket name where the terraform state will reside
70+
- dynamodb_table: Lock table so there are not duplicate tfplans in the mix
71+
- encrypt: Encrypt all traffic to and from the backend
72+
73+
### Required AWS Permissions
74+
75+
Ensure that the AWS credentials used to execute Terraform have the necessary permissions to create, list and modify:
76+
77+
- All SageMaker services (Studio, Pipelines, Canvas, etc.)
78+
- S3 data access and model artifacts
79+
- CloudWatch logging and monitoring
80+
- VPC and networking configuration
81+
82+
## Module Configuration
83+
84+
### Input Variables
85+
86+
For a list of input variables, see the README [Inputs](https://github.com/sourcefuse/terraform-aws-arc-sagemaker#inputs) section.
87+
88+
### Output Values
89+
90+
For a list of outputs, see the README [Outputs](https://github.com/sourcefuse/terraform-aws-arc-sagemaker?tab=readme-ov-file#outputs) section.
91+
92+
## Module Usage
93+
94+
### Basic Usage
95+
96+
For basic usage, see the [examples](https://github.com/sourcefuse/terraform-aws-arc-sagemaker/tree/main/examples) folder.
97+
98+
This example will create:
99+
100+
- **SageMaker Studio Domain**: Complete domain setup with VPC integration
101+
- **User Profiles**: Multiple user profiles with customizable settings
102+
- **ML Pipelines**: SageMaker Pipeline support with S3 integration
103+
- **model**: Flexible SageMaker Model creation with configurable containers
104+
- **Endpoint Configurations**: Fine-grained control of production variants, data capture, async inference, and shadow variants
105+
- **Endpoints**: Full deployment configuration including blue/green and rolling updates, rollback alarms, and traffic routing policies
106+
107+
### Tips and Recommendations
108+
109+
- The module focuses on provisioning SageMaker. The convention-based approach enables downstream services to easily attach to the SageMaker. Adjust the configuration parameters as needed for your specific use case.
110+
111+
## Troubleshooting
112+
113+
### Reporting Issues
114+
115+
If you encounter a bug or issue, please report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-sagemaker/issues).
116+
117+
## Security Considerations
118+
119+
### AWS VPC
120+
121+
Understand the security considerations related to Sagemaker on AWS when using this module.
122+
123+
### Best Practices for AWS Sagemaker
124+
125+
Follow best practices to ensure secure Sagemaker configurations:
126+
127+
- [AWS Sagemaker Security Best Practices](https://docs.aws.amazon.com/config/latest/developerguide/security-best-practices-for-SageMaker.html)
128+
129+
## Contributing and Community Support
130+
131+
### Contributing Guidelines
132+
133+
Contribute to the module by following the guidelines outlined in the [CONTRIBUTING.md](https://github.com/sourcefuse/terraform-aws-arc-sagemaker/blob/main/CONTRIBUTING.md) file.
134+
135+
### Reporting Bugs and Issues
136+
137+
If you find a bug or issue, report it on the [GitHub repository](https://github.com/sourcefuse/terraform-aws-arc-sagemaker/issues).
138+
139+
## License
140+
141+
### License Information
142+
143+
This module is licensed under the Apache 2.0 license. Refer to the [LICENSE](https://github.com/sourcefuse/terraform-aws-arc-sagemaker/blob/main/LICENSE) file for more details.
144+
145+
### Open Source Contribution
146+
147+
Contribute to open source by using and enhancing this module. Your contributions are welcome!

0 commit comments

Comments
 (0)