CreateVpcConfiguration
Creates a VPC configuration that lets a knowledge base connect to a resource in your private VPC. This operation is asynchronous: it returns a vpcConfigurationId with status CREATING. Poll GetVpcConfiguration until the status becomes CREATED or CREATE_FAILED.
Request Syntax
POST /knowledgebases/knowledgeBaseId/vpcconfigurations/ HTTP/1.1
Content-type: application/json
{
"clientToken": "string",
"description": "string",
"hostHeader": "string",
"name": "string",
"port": number,
"protocol": "string",
"resolutionMode": "string",
"resourceTarget": "string",
"subnetIds": [ "string" ],
"tlsServerName": "string",
"vpcId": "string"
}
URI Request Parameters
The request uses the following URI parameters.
- knowledgeBaseId
-
The unique identifier of the knowledge base to associate this VPC configuration with.
Pattern:
[0-9a-zA-Z]{10}Required: Yes
Request Body
The request accepts the following data in JSON format.
- clientToken
-
A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request but does not return an error.
Type: String
Length Constraints: Minimum length of 33. Maximum length of 256.
Pattern:
[a-zA-Z0-9](-*[a-zA-Z0-9]){0,256}Required: No
- description
-
An optional description of the VPC configuration. If you don't specify a description, the VPC configuration has no description.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 512.
Pattern:
[^\p{C}]*Required: No
- hostHeader
-
An optional HTTP
Hostheader value to send when invoking the resource. Set this only if your resource (or an upstream router or ingress) routes by theHostheader and that host differs from the target. This setting is independent oftlsServerName.Type: String
Length Constraints: Minimum length of 1. Maximum length of 255.
Pattern:
[A-Za-z0-9._:\[\]-]{1,255}Required: No
- name
-
An optional human-readable name for the VPC configuration. If you don't specify a name, the VPC configuration has no name.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 128.
Pattern:
[a-zA-Z0-9]([a-zA-Z0-9 _-]*[a-zA-Z0-9])?Required: No
- port
-
The port on which to reach the resource.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 65535.
Required: Yes
- protocol
-
The protocol used to connect to the resource. Specify
HTTPfor plaintext orHTTPSfor TLS. When you specifyHTTPS, you must also providetlsServerName.Type: String
Valid Values:
HTTP | HTTPSRequired: Yes
- resolutionMode
-
Controls how a domain-name
resourceTargetis resolved. This applies only when the target is a domain name; it has no effect for IP-address targets, which have no name to resolve. In all cases the resolved address must be reachable from inside your VPC. Valid values:-
IN_VPC(default, recommended) – The target domain name is resolved privately, using the DNS resolvers of the VPC, such as private Route 53 hosted zones or on-premises DNS reachable from the VPC. Use this for targets that are private to your VPC, such as internal load balancers, private hosted-zone names, or on-premises hosts. -
PUBLIC– The target domain name is resolved against public DNS resolvers. Select this only when the target's domain name must be resolved through public DNS and the resulting address is still reachable from the VPC, an uncommon split-horizon configuration. If you are unsure, useIN_VPC.
Type: String
Valid Values:
PUBLIC | IN_VPCRequired: Yes
-
- resourceTarget
-
The private IPv4 address or DNS name of the resource you want the knowledge base to reach. The target must be privately reachable from inside your VPC, such as an internal load balancer or a private IP. The following are not supported:
-
Internet-facing endpoints
-
Loopback addresses
-
Link-local addresses
-
Wildcard addresses
-
Multicast addresses
-
IPv6 literals
Type: String
Length Constraints: Minimum length of 1. Maximum length of 255.
Required: Yes
-
- subnetIds
-
The subnets, in the VPC identified by
vpcId, that the knowledge base uses to connect to the resource.Type: Array of strings
Array Members: Minimum number of 1 item. Maximum number of 6 items.
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
subnet-[a-zA-Z0-9]+Required: Yes
- tlsServerName
-
The expected TLS server name. The service matches this value against the Subject Alternative Names on your resource's TLS certificate during invocation. This field is required when
protocolisHTTPS. Set it to a hostname on your certificate, such asapp.internal.example.com. You can use a single leftmost wildcard, such as*.example.com. The value must be a hostname without a port.Type: String
Length Constraints: Minimum length of 1. Maximum length of 253.
Pattern:
(\*\.)?([A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)*[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?Required: No
- vpcId
-
The identifier of the VPC that the knowledge base connects through to reach the resource.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
vpc-[a-zA-Z0-9]+Required: Yes
Response Syntax
HTTP/1.1 202
Content-type: application/json
{
"status": "string",
"vpcConfigurationId": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 202 response.
The following data is returned in JSON format by the service.
- status
-
The current status of the VPC configuration. Immediately after creation this is
CREATING.Type: String
Valid Values:
CREATING | CREATED | DELETING | CREATE_FAILED | DELETE_FAILED - vpcConfigurationId
-
The unique identifier of the VPC configuration that was created.
Type: String
Length Constraints: Fixed length of 32.
Pattern:
[a-z0-9](?:[a-z0-9-]{30}[a-z0-9])
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
The request is denied because of missing access permissions.
HTTP Status Code: 403
- ConflictException
-
There was a conflict performing an operation.
HTTP Status Code: 409
- InternalServerException
-
An internal server error occurred. Retry your request.
HTTP Status Code: 500
- ResourceNotFoundException
-
The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
HTTP Status Code: 404
- ServiceQuotaExceededException
-
The number of requests exceeds the service quota. Resubmit your request later.
HTTP Status Code: 402
- ThrottlingException
-
The number of requests exceeds the limit. Resubmit your request later.
HTTP Status Code: 429
- ValidationException
-
Input validation failed. Check your request parameters and retry the request.
- fieldList
-
A list of objects containing fields that caused validation errors and their corresponding validation error messages.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: