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

Sagemaker Endpoint Resource #1034

Merged
merged 5 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
353 changes: 353 additions & 0 deletions apis/sagemaker/v1beta1/zz_endpoint_types.go

Large diffs are not rendered by default.

1,157 changes: 996 additions & 161 deletions apis/sagemaker/v1beta1/zz_generated.deepcopy.go

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions apis/sagemaker/v1beta1/zz_generated.managed.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions apis/sagemaker/v1beta1/zz_generated.managedlist.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions apis/sagemaker/v1beta1/zz_generated.resolvers.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 114 additions & 0 deletions apis/sagemaker/v1beta1/zz_generated_terraformed.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions config/externalname.go
Original file line number Diff line number Diff line change
Expand Up @@ -2119,6 +2119,8 @@ var NoForkExternalNameConfigs = map[string]config.ExternalName{
"aws_sagemaker_workforce": config.ParameterAsIdentifier("workforce_name"),
// SageMaker Workteams can be imported using the workteam_name
"aws_sagemaker_workteam": config.ParameterAsIdentifier("workteam_name"),
// Endpoints can be imported using the name
"aws_sagemaker_endpoint": config.NameAsIdentifier,
// Endpoint configurations can be imported using the name
"aws_sagemaker_endpoint_configuration": config.NameAsIdentifier,
// SageMaker Code Images can be imported using the name
Expand Down
5 changes: 0 additions & 5 deletions config/externalnamenottested.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,6 @@ var ExternalNameNotTestedConfigs = map[string]config.ExternalName{

// sagemaker
//
// Endpoints can be imported using the name
"aws_sagemaker_endpoint": config.NameAsIdentifier,
// SageMaker Flow Definitions can be imported using the flow_definition_name
"aws_sagemaker_flow_definition": config.ParameterAsIdentifier("flow_definition_name"),
// SageMaker Human Task UIs can be imported using the human_task_ui_name
Expand Down Expand Up @@ -739,9 +737,6 @@ var ExternalNameNotTestedConfigs = map[string]config.ExternalName{
// SESv2 (Simple Email V2) Dedicated IP Assignment can be imported using the id, which is a comma-separated string made up of ip and destination_pool_name
"aws_sesv2_dedicated_ip_assignment": config.IdentifierFromProvider,

// ssoadmin
blakeromano marked this conversation as resolved.
Show resolved Hide resolved
//

// transcribe
//
// Transcribe MedicalVocabulary can be imported using the vocabulary_name
Expand Down
2 changes: 1 addition & 1 deletion config/generated.lst

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions config/sagemaker/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ func Configure(p *config.Provider) {
p.AddResourceConfigurator("aws_sagemaker_device_fleet", func(r *config.Resource) {
r.Path = "devicefleet"
})
p.AddResourceConfigurator("aws_sagemaker_endpoint", func(r *config.Resource) {
r.References["endpoint_config_name"] = config.Reference{
TerraformName: "aws_sagemaker_endpoint_configuration",
}
r.UseAsync = true
})
}
16 changes: 16 additions & 0 deletions examples-generated/sagemaker/endpoint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: sagemaker.aws.upbound.io/v1beta1
kind: Endpoint
metadata:
annotations:
meta.upbound.io/example-id: sagemaker/v1beta1/endpoint
labels:
testing.upbound.io/example-name: e
name: e
spec:
forProvider:
endpointConfigNameSelector:
matchLabels:
testing.upbound.io/example-name: ec
blakeromano marked this conversation as resolved.
Show resolved Hide resolved
region: us-west-1
tags:
Name: foo
99 changes: 99 additions & 0 deletions examples/sagemaker/endpoint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
apiVersion: sagemaker.aws.upbound.io/v1beta1
kind: Endpoint
metadata:
annotations:
meta.upbound.io/example-id: sagemaker/v1beta1/endpoint
blakeromano marked this conversation as resolved.
Show resolved Hide resolved
upjet.upbound.io/manual-intervention: "This resource is skipping because the EndpointConfiguration resource on which this resource depends was skipped."
labels:
testing.upbound.io/example-name: e
name: e
spec:
forProvider:
endpointConfigNameSelector:
matchLabels:
testing.upbound.io/example-name: ec
region: us-east-1
tags:
Name: foo
---
apiVersion: sagemaker.aws.upbound.io/v1beta1
kind: EndpointConfiguration
metadata:
annotations:
meta.upbound.io/example-id: sagemaker/v1beta1/endpoint
upjet.upbound.io/manual-intervention: "It requires an image which can be create/deleted only using AWS CLI"
labels:
testing.upbound.io/example-name: ec
name: ec
spec:
forProvider:
productionVariants:
- initialInstanceCount: 1
instanceType: ml.t2.medium
modelNameSelector:
matchLabels:
testing.upbound.io/example-name: example
variantName: variant-1
region: us-east-1
tags:
Name: foo
---
apiVersion: sagemaker.aws.upbound.io/v1beta1
kind: Model
metadata:
annotations:
meta.upbound.io/example-id: sagemaker/v1beta1/endpoint
upjet.upbound.io/manual-intervention: "It requires an image which can be create/deleted only using AWS CLI"
labels:
testing.upbound.io/example-name: example
name: example
spec:
forProvider:
executionRoleArnSelector:
matchLabels:
testing.upbound.io/example-name: example
primaryContainer:
- image: ${data.aws_account_id}.dkr.ecr.us-east-1.amazonaws.com/sagemaker-scikit-learn:latest
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this the only reason for the manual intervention annotation? I'm not very familiar with Sagemaker, but couldn't you just define the endpoint and EndpointConfiguration in here, and not have a model?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You need to have a model for an EndpointConfiguration and need an EndpointConfiguration for an Endpoint hence the need for the label

region: us-east-1
---
apiVersion: iam.aws.upbound.io/v1beta1
kind: Role
metadata:
annotations:
meta.upbound.io/example-id: sagemaker/v1beta1/endpoint
upjet.upbound.io/manual-intervention: "It requires an image which can be create/deleted only using AWS CLI"
labels:
testing.upbound.io/example-name: example
name: example
spec:
forProvider:
assumeRolePolicy: |
{
"Version": "2012-10-17",
"Statement": [
{
"Action": "sts:AssumeRole",
"Principal": {
"Service": "sagemaker.amazonaws.com"
},
"Effect": "Allow",
"Sid": ""
}
]
}
---
apiVersion: iam.aws.upbound.io/v1beta1
kind: RolePolicyAttachment
metadata:
annotations:
meta.upbound.io/example-id: sagemaker/v1beta1/endpoint
upjet.upbound.io/manual-intervention: "It requires an image which can be create/deleted only using AWS CLI"
labels:
testing.upbound.io/example-name: example
name: example
spec:
forProvider:
policyArn: "arn:aws:iam::aws:policy/AmazonSageMakerFullAccess"
roleSelector:
matchLabels:
testing.upbound.io/example-name: example
Loading
Loading