Skip to content
v2.277.0

VpcConfigProperty Struct ​

Specifies an Amazon Virtual Private Cloud (VPC) that your SageMaker jobs, hosted models, and compute resources have access to.

You can control access to and from your resources by configuring a VPC. For more information, see Give SageMaker Access to Resources in your Amazon VPC .

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_sagemaker as sagemaker } from 'aws-cdk-lib';
const vpcConfigProperty: sagemaker.CfnModelExplainabilityJobDefinition.VpcConfigProperty = {
  securityGroupIds: ['securityGroupIds'],
  subnets: ['subnets'],
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_sagemaker as sagemaker

vpc_config_property = sagemaker.CfnModelExplainabilityJobDefinition.VpcConfigProperty(
    security_group_ids=["securityGroupIds"],
    subnets=["subnets"]
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.sagemaker.*;

VpcConfigProperty vpcConfigProperty = VpcConfigProperty.builder()
        .securityGroupIds(List.of("securityGroupIds"))
        .subnets(List.of("subnets"))
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Sagemaker;

var vpcConfigProperty = new VpcConfigProperty {
    SecurityGroupIds = new [] { "securityGroupIds" },
    Subnets = new [] { "subnets" }
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

vpcConfigProperty := &VpcConfigProperty{
	SecurityGroupIds: []*string{
		jsii.String("securityGroupIds"),
	},
	Subnets: []*string{
		jsii.String("subnets"),
	},
}

Properties ​

securityGroupIdsstring[]security_group_idstyping.List[str]securityGroupIdsList<String>SecurityGroupIdsstring[]SecurityGroupIds*[]*string required #
The VPC security group IDs, in the form `sg-xxxxxxxx` .

Specify the security groups for the VPC that is specified in the Subnets field.

subnetsstring[]subnetstyping.List[str]subnetsList<String>Subnetsstring[]Subnets*[]*string required #
The ID of the subnets in the VPC to which you want to connect your training job or model.

For information about the availability of specific instance types, see Supported Instance Types and Availability Zones .