create_service
(**kwargs)¶Creates an Amazon Web Services Migration Hub Refactor Spaces service. The account owner of the service is always the environment owner, regardless of which account in the environment creates the service. Services have either a URL endpoint in a virtual private cloud (VPC), or a Lambda function endpoint.
Warning
If an Amazon Web Services resource is launched in a service VPC, and you want it to be accessible to all of an environment’s services with VPCs and routes, apply the RefactorSpacesSecurityGroup
to the resource. Alternatively, to add more cross-account constraints, apply your own security group.
See also: AWS API Documentation
Request Syntax
response = client.create_service(
ApplicationIdentifier='string',
ClientToken='string',
Description='string',
EndpointType='LAMBDA'|'URL',
EnvironmentIdentifier='string',
LambdaEndpoint={
'Arn': 'string'
},
Name='string',
Tags={
'string': 'string'
},
UrlEndpoint={
'HealthUrl': 'string',
'Url': 'string'
},
VpcId='string'
)
[REQUIRED]
The ID of the application which the service is created.
A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
This field is autopopulated if not provided.
[REQUIRED]
The type of endpoint to use for the service. The type can be a URL in a VPC or an Lambda function.
[REQUIRED]
The ID of the environment in which the service is created.
The configuration for the Lambda endpoint type.
The Amazon Resource Name (ARN) of the Lambda function or alias.
[REQUIRED]
The name of the service.
The tags to assign to the service. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key-value pair..
The configuration for the URL endpoint type. When creating a route to a service, Refactor Spaces automatically resolves the address in the UrlEndpointInput
object URL when the Domain Name System (DNS) time-to-live (TTL) expires, or every 60 seconds for TTLs less than 60 seconds.
The health check URL of the URL endpoint type. If the URL is a public endpoint, the HealthUrl
must also be a public endpoint. If the URL is a private endpoint inside a virtual private cloud (VPC), the health URL must also be a private endpoint, and the host must be the same as the URL.
The URL to route traffic to. The URL must be an rfc3986-formatted URL. If the host is a domain name, the name must be resolvable over the public internet. If the scheme is https
, the top level domain of the host must be listed in the IANA root zone database.
dict
Response Syntax
{
'ApplicationId': 'string',
'Arn': 'string',
'CreatedByAccountId': 'string',
'CreatedTime': datetime(2015, 1, 1),
'Description': 'string',
'EndpointType': 'LAMBDA'|'URL',
'EnvironmentId': 'string',
'LambdaEndpoint': {
'Arn': 'string'
},
'LastUpdatedTime': datetime(2015, 1, 1),
'Name': 'string',
'OwnerAccountId': 'string',
'ServiceId': 'string',
'State': 'CREATING'|'ACTIVE'|'DELETING'|'FAILED',
'Tags': {
'string': 'string'
},
'UrlEndpoint': {
'HealthUrl': 'string',
'Url': 'string'
},
'VpcId': 'string'
}
Response Structure
(dict) --
ApplicationId (string) --
The ID of the application that the created service belongs to.
Arn (string) --
The Amazon Resource Name (ARN) of the service.
CreatedByAccountId (string) --
The Amazon Web Services account ID of the service creator.
CreatedTime (datetime) --
A timestamp that indicates when the service is created.
Description (string) --
The description of the created service.
EndpointType (string) --
The endpoint type of the service.
EnvironmentId (string) --
The unique identifier of the environment.
LambdaEndpoint (dict) --
The configuration for the Lambda endpoint type.
Arn (string) --
The Amazon Resource Name (ARN) of the Lambda function or alias.
LastUpdatedTime (datetime) --
A timestamp that indicates when the service was last updated.
Name (string) --
The name of the service.
OwnerAccountId (string) --
The Amazon Web Services account ID of the service owner.
ServiceId (string) --
The unique identifier of the service.
State (string) --
The current state of the service.
Tags (dict) --
The tags assigned to the created service. A tag is a label that you assign to an Amazon Web Services resource. Each tag consists of a key-value pair..
UrlEndpoint (dict) --
The configuration for the URL endpoint type.
HealthUrl (string) --
The health check URL of the URL endpoint type. If the URL is a public endpoint, the HealthUrl
must also be a public endpoint. If the URL is a private endpoint inside a virtual private cloud (VPC), the health URL must also be a private endpoint, and the host must be the same as the URL.
Url (string) --
The URL to route traffic to. The URL must be an rfc3986-formatted URL. If the host is a domain name, the name must be resolvable over the public internet. If the scheme is https
, the top level domain of the host must be listed in the IANA root zone database.
VpcId (string) --
The ID of the VPC.
Exceptions
MigrationHubRefactorSpaces.Client.exceptions.ResourceNotFoundException
MigrationHubRefactorSpaces.Client.exceptions.InternalServerException
MigrationHubRefactorSpaces.Client.exceptions.ConflictException
MigrationHubRefactorSpaces.Client.exceptions.ServiceQuotaExceededException
MigrationHubRefactorSpaces.Client.exceptions.ValidationException
MigrationHubRefactorSpaces.Client.exceptions.ThrottlingException
MigrationHubRefactorSpaces.Client.exceptions.AccessDeniedException