create_instances_from_snapshot
¶
create_instances_from_snapshot(
instance_names: StringList,
availability_zone: string,
bundle_id: NonEmptyString,
*,
config_overrides: Optional[LightsailClientConfig] = None,
attached_disk_mapping: Optional[AttachedDiskMap] = None,
instance_snapshot_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,
source_instance_name: Optional[string] = None,
restore_date: Optional[string] = None,
use_latest_restorable_auto_snapshot: Optional[boolean] = None,
) -> CreateInstancesFromSnapshotResult
Creates one or more new instances from a manual or automatic snapshot of an instance.
The create instances from snapshot operation supports tag-based access control via request tags and resource tags applied to the resource identified by instance snapshot name. For more information, see the Amazon Lightsail Developer Guide.
Parameters:
-
instance_names(StringList) –The names for your new instances.
-
attached_disk_mapping(Optional[AttachedDiskMap], default:None) –An object containing information about one or more disk mappings.
-
availability_zone(string) –The Availability Zone where you want to create your instances. Use the following formatting:
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. -
instance_snapshot_name(Optional[ResourceName], default:None) –The name of the instance snapshot on which you are basing your new instances. Use the get instance snapshots operation to return information about your existing snapshots.
Constraint:
-
This parameter cannot be defined together with the
source instance nameparameter. Theinstance snapshot nameandsource instance nameparameters are mutually exclusive.
-
-
bundle_id(NonEmptyString) –The bundle of specification information for your virtual private server (or instance), including the pricing plan (
micro_x_x). -
user_data(Optional[string], default:None) –You can create a launch script that configures a server with additional user data. For example,
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 for 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. -
source_instance_name(Optional[string], default:None) –The name of the source instance from which the source automatic snapshot was created.
Constraints:
-
This parameter cannot be defined together with the
instance snapshot nameparameter. Thesource instance nameandinstance snapshot nameparameters are mutually exclusive. -
Define this parameter only when creating a new instance from an automatic snapshot. For more information, see the Amazon Lightsail Developer Guide.
-
-
restore_date(Optional[string], default:None) –The date of the automatic snapshot to use for the new instance. Use the
get auto snapshotsoperation to identify the dates of the available automatic snapshots.Constraints:
-
Must be specified in
YYYY-MM-DDformat. -
This parameter cannot be defined together with the
use latest restorable auto snapshotparameter. Therestore dateanduse latest restorable auto snapshotparameters are mutually exclusive. -
Define this parameter only when creating a new instance from an automatic snapshot. For more information, see the Amazon Lightsail Developer Guide.
-
-
use_latest_restorable_auto_snapshot(Optional[boolean], default:None) –A Boolean value to indicate whether to use the latest available automatic snapshot.
Constraints:
-
This parameter cannot be defined together with the
restore dateparameter. Theuse latest restorable auto snapshotandrestore dateparameters are mutually exclusive. -
Define this parameter only when creating a new instance from an automatic snapshot. For more information, see 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/lightsail.py
2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 | |