create_instances
async
¶
create_instances(
instance_names: StringList,
availability_zone: string,
blueprint_id: NonEmptyString,
bundle_id: NonEmptyString,
*,
config_overrides: Optional[AsyncLightsailClientConfig] = None,
custom_image_name: Optional[ResourceName] = None,
user_data: Optional[string] = None,
key_pair_name: Optional[ResourceName] = None,
tags: Optional[TagList] = None,
add_ons: Optional[AddOnRequestList] = None,
ip_address_type: Optional[IpAddressType] = None,
) -> CreateInstancesResult
Creates one or more Amazon Lightsail instances.
The create instances operation supports tag-based access control via request tags. For more information, see the Lightsail Developer Guide.
Parameters:
-
instance_names(StringList) –The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for example:
["MyFirstInstance","MySecondInstance"] -
availability_zone(string) –The Availability Zone in which to create your instance. Use the following format:
us-east-2a(case sensitive). You can get a list of Availability Zones by using the get regions operation. Be sure to add theinclude Availability Zonesparameter to your request. -
custom_image_name(Optional[ResourceName], default:None) –(Discontinued) The name for your custom image.
In releases prior to June 12, 2017, this parameter was ignored by the API. It is now discontinued.
-
blueprint_id(NonEmptyString) –The ID for a virtual private server image (
app_wordpress_x_xorapp_lamp_x_x). Use theget blueprintsoperation to return a list of available images (or blueprints).Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when they become outdated due to operating system updates or new application releases.
-
bundle_id(NonEmptyString) –The bundle of specification information for your virtual private server (or instance), including the pricing plan (
medium_x_x). -
user_data(Optional[string], default:None) –A launch script you can create that configures a server with additional user data. For example, you might want to run
apt-get -y update.Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and CentOS use
yum, Debian and Ubuntu useapt-get, and FreeBSD usespkg. For a complete list, see the Amazon Lightsail Developer Guide. -
key_pair_name(Optional[ResourceName], default:None) –The name of your key pair.
-
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. -
add_ons(Optional[AddOnRequestList], default:None) –An array of objects representing the add-ons to enable for the new instance.
-
ip_address_type(Optional[IpAddressType], default:None) –The IP address type for the instance.
The possible values are
ipv4for IPv4 only,ipv6for IPv6 only, anddualstackfor IPv4 and IPv6.The default value is
dualstack.
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
2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 | |