create_load_balancer
async
¶
create_load_balancer(
load_balancer_name: ResourceName,
instance_port: Port,
*,
config_overrides: Optional[AsyncLightsailClientConfig] = None,
health_check_path: Optional[string] = None,
certificate_name: Optional[ResourceName] = None,
certificate_domain_name: Optional[DomainName] = None,
certificate_alternative_names: Optional[DomainNameList] = None,
tags: Optional[TagList] = None,
ip_address_type: Optional[IpAddressType] = None,
tls_policy_name: Optional[string] = None,
) -> CreateLoadBalancerResult
Creates a Lightsail load balancer. To learn more about deciding whether to load balance your application, see Configure your Lightsail instances for load balancing. You can create up to 10 load balancers per AWS Region in your account.
When you create a load balancer, you can specify a unique name and port settings. To change additional load balancer settings, use the UpdateLoadBalancerAttribute operation.
The create load balancer operation supports tag-based access control via request tags. For more information, see the Amazon Lightsail Developer Guide.
Parameters:
-
load_balancer_name(ResourceName) –The name of your load balancer.
-
instance_port(Port) –The instance port where you're creating your load balancer.
-
health_check_path(Optional[string], default:None) –The path you provided to perform the load balancer health check. If you didn't specify a health check path, Lightsail uses the root path of your website (
"/").You may want to specify a custom health check path other than the root of your application if your home page loads slowly or has a lot of media or scripting on it.
-
certificate_name(Optional[ResourceName], default:None) –The name of the SSL/TLS certificate.
If you specify
certificateName, thencertificateDomainNameis required (and vice-versa). -
certificate_domain_name(Optional[DomainName], default:None) –The domain name with which your certificate is associated (
example.com).If you specify
certificateDomainName, thencertificateNameis required (and vice-versa). -
certificate_alternative_names(Optional[DomainNameList], default:None) –The optional alternative domains and subdomains to use with your SSL/TLS certificate (
www.example.com,example.com,m.example.com,blog.example.com). -
tags(Optional[TagList], default:None) –The tag keys and optional values to add to the resource during create.
Use the
TagResourceaction to tag a resource after it's created. -
ip_address_type(Optional[IpAddressType], default:None) –The IP address type for the load balancer.
The possible values are
ipv4for IPv4 only,ipv6for IPv6 only, anddualstackfor IPv4 and IPv6.The default value is
dualstack. -
tls_policy_name(Optional[string], default:None) –The name of the TLS policy to apply to the load balancer.
Use the GetLoadBalancerTlsPolicies action to get a list of TLS policy names that you can specify.
For more information about load balancer TLS policies, see Configuring TLS security policies on your Amazon Lightsail load balancers in the Amazon Lightsail Developer Guide.
Raises:
-
AccessDeniedException–Lightsail throws this exception when the user cannot be authenticated or uses invalid credentials to access a resource.
-
AccountSetupInProgressException–Lightsail throws this exception when an account is still in the setup in progress state.
-
InvalidInputException–Lightsail throws this exception when user input does not conform to the validation rules of an input field.
Domain and distribution APIs are only available in the N. Virginia (
us-east-1) Amazon Web Services Region. Please set your Amazon Web Services Region configuration tous-east-1to create, view, or edit these resources. -
NotFoundException–Lightsail throws this exception when it cannot find a resource.
-
OperationFailureException–Lightsail throws this exception when an operation fails to execute.
-
RegionSetupInProgressException–Lightsail throws this exception when an operation is performed on resources in an opt-in Region that is currently being set up.
-
ServiceException–A general service exception.
-
UnauthenticatedException–Lightsail throws this exception when the user has not been authenticated.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_lightsail/_services/async_lightsail.py
2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 | |