github.com/pulumi/pulumi-aws/sdk/v6@v6.32.0/go/aws/ec2/instance.go (about) 1 // Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT. 2 // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** 3 4 package ec2 5 6 import ( 7 "context" 8 "reflect" 9 10 "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/internal" 11 "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 12 ) 13 14 // Provides an EC2 instance resource. This allows instances to be created, updated, and deleted. 15 // 16 // ## Example Usage 17 // 18 // ### Basic example using AMI lookup 19 // 20 // <!--Start PulumiCodeChooser --> 21 // ```go 22 // package main 23 // 24 // import ( 25 // 26 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 27 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 28 // 29 // ) 30 // 31 // func main() { 32 // pulumi.Run(func(ctx *pulumi.Context) error { 33 // ubuntu, err := ec2.LookupAmi(ctx, &ec2.LookupAmiArgs{ 34 // MostRecent: pulumi.BoolRef(true), 35 // Filters: []ec2.GetAmiFilter{ 36 // { 37 // Name: "name", 38 // Values: []string{ 39 // "ubuntu/images/hvm-ssd/ubuntu-jammy-22.04-amd64-server-*", 40 // }, 41 // }, 42 // { 43 // Name: "virtualization-type", 44 // Values: []string{ 45 // "hvm", 46 // }, 47 // }, 48 // }, 49 // Owners: []string{ 50 // "099720109477", 51 // }, 52 // }, nil) 53 // if err != nil { 54 // return err 55 // } 56 // _, err = ec2.NewInstance(ctx, "web", &ec2.InstanceArgs{ 57 // Ami: pulumi.String(ubuntu.Id), 58 // InstanceType: pulumi.String(ec2.InstanceType_T3_Micro), 59 // Tags: pulumi.StringMap{ 60 // "Name": pulumi.String("HelloWorld"), 61 // }, 62 // }) 63 // if err != nil { 64 // return err 65 // } 66 // return nil 67 // }) 68 // } 69 // 70 // ``` 71 // <!--End PulumiCodeChooser --> 72 // 73 // ### Spot instance example 74 // 75 // <!--Start PulumiCodeChooser --> 76 // ```go 77 // package main 78 // 79 // import ( 80 // 81 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 82 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 83 // 84 // ) 85 // 86 // func main() { 87 // pulumi.Run(func(ctx *pulumi.Context) error { 88 // this, err := ec2.LookupAmi(ctx, &ec2.LookupAmiArgs{ 89 // MostRecent: pulumi.BoolRef(true), 90 // Owners: []string{ 91 // "amazon", 92 // }, 93 // Filters: []ec2.GetAmiFilter{ 94 // { 95 // Name: "architecture", 96 // Values: []string{ 97 // "arm64", 98 // }, 99 // }, 100 // { 101 // Name: "name", 102 // Values: []string{ 103 // "al2023-ami-2023*", 104 // }, 105 // }, 106 // }, 107 // }, nil) 108 // if err != nil { 109 // return err 110 // } 111 // _, err = ec2.NewInstance(ctx, "this", &ec2.InstanceArgs{ 112 // Ami: pulumi.String(this.Id), 113 // InstanceMarketOptions: &ec2.InstanceInstanceMarketOptionsArgs{ 114 // SpotOptions: &ec2.InstanceInstanceMarketOptionsSpotOptionsArgs{ 115 // MaxPrice: pulumi.String("0.0031"), 116 // }, 117 // }, 118 // InstanceType: pulumi.String(ec2.InstanceType_T4g_Nano), 119 // Tags: pulumi.StringMap{ 120 // "Name": pulumi.String("test-spot"), 121 // }, 122 // }) 123 // if err != nil { 124 // return err 125 // } 126 // return nil 127 // }) 128 // } 129 // 130 // ``` 131 // <!--End PulumiCodeChooser --> 132 // 133 // ### Network and credit specification example 134 // 135 // <!--Start PulumiCodeChooser --> 136 // ```go 137 // package main 138 // 139 // import ( 140 // 141 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 142 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 143 // 144 // ) 145 // 146 // func main() { 147 // pulumi.Run(func(ctx *pulumi.Context) error { 148 // myVpc, err := ec2.NewVpc(ctx, "my_vpc", &ec2.VpcArgs{ 149 // CidrBlock: pulumi.String("172.16.0.0/16"), 150 // Tags: pulumi.StringMap{ 151 // "Name": pulumi.String("tf-example"), 152 // }, 153 // }) 154 // if err != nil { 155 // return err 156 // } 157 // mySubnet, err := ec2.NewSubnet(ctx, "my_subnet", &ec2.SubnetArgs{ 158 // VpcId: myVpc.ID(), 159 // CidrBlock: pulumi.String("172.16.10.0/24"), 160 // AvailabilityZone: pulumi.String("us-west-2a"), 161 // Tags: pulumi.StringMap{ 162 // "Name": pulumi.String("tf-example"), 163 // }, 164 // }) 165 // if err != nil { 166 // return err 167 // } 168 // foo, err := ec2.NewNetworkInterface(ctx, "foo", &ec2.NetworkInterfaceArgs{ 169 // SubnetId: mySubnet.ID(), 170 // PrivateIps: pulumi.StringArray{ 171 // pulumi.String("172.16.10.100"), 172 // }, 173 // Tags: pulumi.StringMap{ 174 // "Name": pulumi.String("primary_network_interface"), 175 // }, 176 // }) 177 // if err != nil { 178 // return err 179 // } 180 // _, err = ec2.NewInstance(ctx, "foo", &ec2.InstanceArgs{ 181 // Ami: pulumi.String("ami-005e54dee72cc1d00"), 182 // InstanceType: pulumi.String(ec2.InstanceType_T2_Micro), 183 // NetworkInterfaces: ec2.InstanceNetworkInterfaceArray{ 184 // &ec2.InstanceNetworkInterfaceArgs{ 185 // NetworkInterfaceId: foo.ID(), 186 // DeviceIndex: pulumi.Int(0), 187 // }, 188 // }, 189 // CreditSpecification: &ec2.InstanceCreditSpecificationArgs{ 190 // CpuCredits: pulumi.String("unlimited"), 191 // }, 192 // }) 193 // if err != nil { 194 // return err 195 // } 196 // return nil 197 // }) 198 // } 199 // 200 // ``` 201 // <!--End PulumiCodeChooser --> 202 // 203 // ### CPU options example 204 // 205 // <!--Start PulumiCodeChooser --> 206 // ```go 207 // package main 208 // 209 // import ( 210 // 211 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 212 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 213 // 214 // ) 215 // 216 // func main() { 217 // pulumi.Run(func(ctx *pulumi.Context) error { 218 // example, err := ec2.NewVpc(ctx, "example", &ec2.VpcArgs{ 219 // CidrBlock: pulumi.String("172.16.0.0/16"), 220 // Tags: pulumi.StringMap{ 221 // "Name": pulumi.String("tf-example"), 222 // }, 223 // }) 224 // if err != nil { 225 // return err 226 // } 227 // exampleSubnet, err := ec2.NewSubnet(ctx, "example", &ec2.SubnetArgs{ 228 // VpcId: example.ID(), 229 // CidrBlock: pulumi.String("172.16.10.0/24"), 230 // AvailabilityZone: pulumi.String("us-east-2a"), 231 // Tags: pulumi.StringMap{ 232 // "Name": pulumi.String("tf-example"), 233 // }, 234 // }) 235 // if err != nil { 236 // return err 237 // } 238 // amzn_linux_2023_ami, err := ec2.LookupAmi(ctx, &ec2.LookupAmiArgs{ 239 // MostRecent: pulumi.BoolRef(true), 240 // Owners: []string{ 241 // "amazon", 242 // }, 243 // Filters: []ec2.GetAmiFilter{ 244 // { 245 // Name: "name", 246 // Values: []string{ 247 // "al2023-ami-2023.*-x86_64", 248 // }, 249 // }, 250 // }, 251 // }, nil) 252 // if err != nil { 253 // return err 254 // } 255 // _, err = ec2.NewInstance(ctx, "example", &ec2.InstanceArgs{ 256 // Ami: pulumi.String(amzn_linux_2023_ami.Id), 257 // InstanceType: pulumi.String(ec2.InstanceType_C6a_2XLarge), 258 // SubnetId: exampleSubnet.ID(), 259 // CpuOptions: &ec2.InstanceCpuOptionsArgs{ 260 // CoreCount: pulumi.Int(2), 261 // ThreadsPerCore: pulumi.Int(2), 262 // }, 263 // Tags: pulumi.StringMap{ 264 // "Name": pulumi.String("tf-example"), 265 // }, 266 // }) 267 // if err != nil { 268 // return err 269 // } 270 // return nil 271 // }) 272 // } 273 // 274 // ``` 275 // <!--End PulumiCodeChooser --> 276 // 277 // ### Host resource group or Licence Manager registered AMI example 278 // 279 // A host resource group is a collection of Dedicated Hosts that you can manage as a single entity. As you launch instances, License Manager allocates the hosts and launches instances on them based on the settings that you configured. You can add existing Dedicated Hosts to a host resource group and take advantage of automated host management through License Manager. 280 // 281 // > **NOTE:** A dedicated host is automatically associated with a License Manager host resource group if **Allocate hosts automatically** is enabled. Otherwise, use the `hostResourceGroupArn` argument to explicitly associate the instance with the host resource group. 282 // 283 // <!--Start PulumiCodeChooser --> 284 // ```go 285 // package main 286 // 287 // import ( 288 // 289 // "github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2" 290 // "github.com/pulumi/pulumi/sdk/v3/go/pulumi" 291 // 292 // ) 293 // 294 // func main() { 295 // pulumi.Run(func(ctx *pulumi.Context) error { 296 // _, err := ec2.NewInstance(ctx, "this", &ec2.InstanceArgs{ 297 // Ami: pulumi.String("ami-0dcc1e21636832c5d"), 298 // InstanceType: pulumi.String(ec2.InstanceType_M5_Large), 299 // HostResourceGroupArn: pulumi.String("arn:aws:resource-groups:us-west-2:012345678901:group/win-testhost"), 300 // Tenancy: pulumi.String("host"), 301 // }) 302 // if err != nil { 303 // return err 304 // } 305 // return nil 306 // }) 307 // } 308 // 309 // ``` 310 // <!--End PulumiCodeChooser --> 311 // 312 // ## Tag Guide 313 // 314 // These are the five types of tags you might encounter relative to an `ec2.Instance`: 315 // 316 // 1. **Instance tags**: Applied to instances but not to `ebsBlockDevice` and `rootBlockDevice` volumes. 317 // 2. **Default tags**: Applied to the instance and to `ebsBlockDevice` and `rootBlockDevice` volumes. 318 // 3. **Volume tags**: Applied during creation to `ebsBlockDevice` and `rootBlockDevice` volumes. 319 // 4. **Root block device tags**: Applied only to the `rootBlockDevice` volume. These conflict with `volumeTags`. 320 // 5. **EBS block device tags**: Applied only to the specific `ebsBlockDevice` volume you configure them for and cannot be updated. These conflict with `volumeTags`. 321 // 322 // Do not use `volumeTags` if you plan to manage block device tags outside the `ec2.Instance` configuration, such as using `tags` in an `ebs.Volume` resource attached via `ec2.VolumeAttachment`. Doing so will result in resource cycling and inconsistent behavior. 323 // 324 // ## Import 325 // 326 // Using `pulumi import`, import instances using the `id`. For example: 327 // 328 // ```sh 329 // $ pulumi import aws:ec2/instance:Instance web i-12345678 330 // ``` 331 type Instance struct { 332 pulumi.CustomResourceState 333 334 // AMI to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifes an AMI. If an AMI is specified in the Launch Template, setting `ami` will override the AMI specified in the Launch Template. 335 Ami pulumi.StringOutput `pulumi:"ami"` 336 // ARN of the instance. 337 Arn pulumi.StringOutput `pulumi:"arn"` 338 // Whether to associate a public IP address with an instance in a VPC. 339 AssociatePublicIpAddress pulumi.BoolOutput `pulumi:"associatePublicIpAddress"` 340 // AZ to start the instance in. 341 AvailabilityZone pulumi.StringOutput `pulumi:"availabilityZone"` 342 // Describes an instance's Capacity Reservation targeting option. See Capacity Reservation Specification below for more details. 343 // 344 // > **NOTE:** Changing `cpuCoreCount` and/or `cpuThreadsPerCore` will cause the resource to be destroyed and re-created. 345 CapacityReservationSpecification InstanceCapacityReservationSpecificationOutput `pulumi:"capacityReservationSpecification"` 346 // Sets the number of CPU cores for an instance. This option is only supported on creation of instance type that support CPU Options [CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API. 347 // 348 // Deprecated: use 'cpu_options' argument instead 349 CpuCoreCount pulumi.IntOutput `pulumi:"cpuCoreCount"` 350 // The CPU options for the instance. See CPU Options below for more details. 351 CpuOptions InstanceCpuOptionsOutput `pulumi:"cpuOptions"` 352 // If set to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information. 353 // 354 // Deprecated: use 'cpu_options' argument instead 355 CpuThreadsPerCore pulumi.IntOutput `pulumi:"cpuThreadsPerCore"` 356 // Configuration block for customizing the credit specification of the instance. See Credit Specification below for more details. This provider will only perform drift detection of its value when present in a configuration. Removing this configuration on existing instances will only stop managing it. It will not change the configuration back to the default for the instance type. 357 CreditSpecification InstanceCreditSpecificationPtrOutput `pulumi:"creditSpecification"` 358 // If true, enables [EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection). 359 DisableApiStop pulumi.BoolOutput `pulumi:"disableApiStop"` 360 // If true, enables [EC2 Instance Termination Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination). 361 DisableApiTermination pulumi.BoolOutput `pulumi:"disableApiTermination"` 362 // One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects. 363 EbsBlockDevices InstanceEbsBlockDeviceArrayOutput `pulumi:"ebsBlockDevices"` 364 // If true, the launched EC2 instance will be EBS-optimized. Note that if this is not set on an instance type that is optimized by default then this will show as disabled but if the instance type is optimized by default then there is no need to set this and there is no effect to disabling it. See the [EBS Optimized section](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) of the AWS User Guide for more information. 365 EbsOptimized pulumi.BoolOutput `pulumi:"ebsOptimized"` 366 // Enable Nitro Enclaves on launched instances. See Enclave Options below for more details. 367 EnclaveOptions InstanceEnclaveOptionsOutput `pulumi:"enclaveOptions"` 368 // One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects. 369 EphemeralBlockDevices InstanceEphemeralBlockDeviceArrayOutput `pulumi:"ephemeralBlockDevices"` 370 // If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `passwordData` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. 371 GetPasswordData pulumi.BoolPtrOutput `pulumi:"getPasswordData"` 372 // If true, the launched EC2 instance will support hibernation. 373 Hibernation pulumi.BoolPtrOutput `pulumi:"hibernation"` 374 // ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host. 375 HostId pulumi.StringOutput `pulumi:"hostId"` 376 // ARN of the host resource group in which to launch the instances. If you specify an ARN, omit the `tenancy` parameter or set it to `host`. 377 HostResourceGroupArn pulumi.StringOutput `pulumi:"hostResourceGroupArn"` 378 // IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. Ensure your credentials have the correct permission to assign the instance profile according to the [EC2 documentation](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html#roles-usingrole-ec2instance-permissions), notably `iam:PassRole`. 379 IamInstanceProfile pulumi.StringOutput `pulumi:"iamInstanceProfile"` 380 // Shutdown behavior for the instance. Amazon defaults this to `stop` for EBS-backed instances and `terminate` for instance-store instances. Cannot be set on instance-store instances. See [Shutdown Behavior](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior) for more information. 381 InstanceInitiatedShutdownBehavior pulumi.StringOutput `pulumi:"instanceInitiatedShutdownBehavior"` 382 // Indicates whether this is a Spot Instance or a Scheduled Instance. 383 InstanceLifecycle pulumi.StringOutput `pulumi:"instanceLifecycle"` 384 // Describes the market (purchasing) option for the instances. See Market Options below for details on attributes. 385 InstanceMarketOptions InstanceInstanceMarketOptionsOutput `pulumi:"instanceMarketOptions"` 386 // State of the instance. One of: `pending`, `running`, `shutting-down`, `terminated`, `stopping`, `stopped`. See [Instance Lifecycle](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) for more information. 387 InstanceState pulumi.StringOutput `pulumi:"instanceState"` 388 // Instance type to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifies an instance type. If an instance type is specified in the Launch Template, setting `instanceType` will override the instance type specified in the Launch Template. Updates to this field will trigger a stop/start of the EC2 instance. 389 InstanceType pulumi.StringOutput `pulumi:"instanceType"` 390 // Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. 391 Ipv6AddressCount pulumi.IntOutput `pulumi:"ipv6AddressCount"` 392 // Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface 393 Ipv6Addresses pulumi.StringArrayOutput `pulumi:"ipv6Addresses"` 394 // Key name of the Key Pair to use for the instance; which can be managed using the `ec2.KeyPair` resource. 395 KeyName pulumi.StringOutput `pulumi:"keyName"` 396 // Specifies a Launch Template to configure the instance. Parameters configured on this resource will override the corresponding parameters in the Launch Template. See Launch Template Specification below for more details. 397 LaunchTemplate InstanceLaunchTemplatePtrOutput `pulumi:"launchTemplate"` 398 // Maintenance and recovery options for the instance. See Maintenance Options below for more details. 399 MaintenanceOptions InstanceMaintenanceOptionsOutput `pulumi:"maintenanceOptions"` 400 // Customize the metadata options of the instance. See Metadata Options below for more details. 401 MetadataOptions InstanceMetadataOptionsOutput `pulumi:"metadataOptions"` 402 // If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0) 403 Monitoring pulumi.BoolOutput `pulumi:"monitoring"` 404 // Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details. 405 NetworkInterfaces InstanceNetworkInterfaceArrayOutput `pulumi:"networkInterfaces"` 406 // ARN of the Outpost the instance is assigned to. 407 OutpostArn pulumi.StringOutput `pulumi:"outpostArn"` 408 // Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if `getPasswordData` is true. Note that this encrypted value will be stored in the state file, as with all exported attributes. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. 409 PasswordData pulumi.StringOutput `pulumi:"passwordData"` 410 // Placement Group to start the instance in. 411 PlacementGroup pulumi.StringOutput `pulumi:"placementGroup"` 412 // Number of the partition the instance is in. Valid only if the `ec2.PlacementGroup` resource's `strategy` argument is set to `"partition"`. 413 PlacementPartitionNumber pulumi.IntOutput `pulumi:"placementPartitionNumber"` 414 // ID of the instance's primary network interface. 415 PrimaryNetworkInterfaceId pulumi.StringOutput `pulumi:"primaryNetworkInterfaceId"` 416 // Private DNS name assigned to the instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC. 417 PrivateDns pulumi.StringOutput `pulumi:"privateDns"` 418 // Options for the instance hostname. The default values are inherited from the subnet. See Private DNS Name Options below for more details. 419 PrivateDnsNameOptions InstancePrivateDnsNameOptionsOutput `pulumi:"privateDnsNameOptions"` 420 // Private IP address to associate with the instance in a VPC. 421 PrivateIp pulumi.StringOutput `pulumi:"privateIp"` 422 // Public DNS name assigned to the instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC. 423 PublicDns pulumi.StringOutput `pulumi:"publicDns"` 424 // Public IP address assigned to the instance, if applicable. **NOTE**: If you are using an `ec2.Eip` with your instance, you should refer to the EIP's address directly and not use `publicIp` as this field will change after the EIP is attached. 425 PublicIp pulumi.StringOutput `pulumi:"publicIp"` 426 // Configuration block to customize details about the root block device of the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a list containing one object. 427 RootBlockDevice InstanceRootBlockDeviceOutput `pulumi:"rootBlockDevice"` 428 // List of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e., referenced in a `networkInterface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type. 429 SecondaryPrivateIps pulumi.StringArrayOutput `pulumi:"secondaryPrivateIps"` 430 // List of security group names to associate with. 431 // 432 // > **NOTE:** If you are creating Instances in a VPC, use `vpcSecurityGroupIds` instead. 433 // 434 // Deprecated: Use of `securityGroups` is discouraged as it does not allow for changes and will force your instance to be replaced if changes are made. To avoid this, use `vpcSecurityGroupIds` which allows for updates. 435 SecurityGroups pulumi.StringArrayOutput `pulumi:"securityGroups"` 436 // Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. Defaults true. 437 SourceDestCheck pulumi.BoolPtrOutput `pulumi:"sourceDestCheck"` 438 // If the request is a Spot Instance request, the ID of the request. 439 SpotInstanceRequestId pulumi.StringOutput `pulumi:"spotInstanceRequestId"` 440 // VPC Subnet ID to launch in. 441 SubnetId pulumi.StringOutput `pulumi:"subnetId"` 442 // Map of tags to assign to the resource. Note that these tags apply to the instance and not block storage devices. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 443 Tags pulumi.StringMapOutput `pulumi:"tags"` 444 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 445 // 446 // Deprecated: Please use `tags` instead. 447 TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"` 448 // Tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of `dedicated` runs on single-tenant hardware. The `host` tenancy is not supported for the import-instance command. Valid values are `default`, `dedicated`, and `host`. 449 Tenancy pulumi.StringOutput `pulumi:"tenancy"` 450 // User data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `userDataBase64` instead. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. 451 UserData pulumi.StringOutput `pulumi:"userData"` 452 // Can be used instead of `userData` to pass base64-encoded binary data directly. Use this instead of `userData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. 453 UserDataBase64 pulumi.StringOutput `pulumi:"userDataBase64"` 454 // When used in combination with `userData` or `userDataBase64` will trigger a destroy and recreate when set to `true`. Defaults to `false` if not set. 455 UserDataReplaceOnChange pulumi.BoolPtrOutput `pulumi:"userDataReplaceOnChange"` 456 // Map of tags to assign, at instance-creation time, to root and EBS volumes. 457 // 458 // > **NOTE:** Do not use `volumeTags` if you plan to manage block device tags outside the `ec2.Instance` configuration, such as using `tags` in an `ebs.Volume` resource attached via `ec2.VolumeAttachment`. Doing so will result in resource cycling and inconsistent behavior. 459 VolumeTags pulumi.StringMapOutput `pulumi:"volumeTags"` 460 // List of security group IDs to associate with. 461 VpcSecurityGroupIds pulumi.StringArrayOutput `pulumi:"vpcSecurityGroupIds"` 462 } 463 464 // NewInstance registers a new resource with the given unique name, arguments, and options. 465 func NewInstance(ctx *pulumi.Context, 466 name string, args *InstanceArgs, opts ...pulumi.ResourceOption) (*Instance, error) { 467 if args == nil { 468 args = &InstanceArgs{} 469 } 470 471 opts = internal.PkgResourceDefaultOpts(opts) 472 var resource Instance 473 err := ctx.RegisterResource("aws:ec2/instance:Instance", name, args, &resource, opts...) 474 if err != nil { 475 return nil, err 476 } 477 return &resource, nil 478 } 479 480 // GetInstance gets an existing Instance resource's state with the given name, ID, and optional 481 // state properties that are used to uniquely qualify the lookup (nil if not required). 482 func GetInstance(ctx *pulumi.Context, 483 name string, id pulumi.IDInput, state *InstanceState, opts ...pulumi.ResourceOption) (*Instance, error) { 484 var resource Instance 485 err := ctx.ReadResource("aws:ec2/instance:Instance", name, id, state, &resource, opts...) 486 if err != nil { 487 return nil, err 488 } 489 return &resource, nil 490 } 491 492 // Input properties used for looking up and filtering Instance resources. 493 type instanceState struct { 494 // AMI to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifes an AMI. If an AMI is specified in the Launch Template, setting `ami` will override the AMI specified in the Launch Template. 495 Ami *string `pulumi:"ami"` 496 // ARN of the instance. 497 Arn *string `pulumi:"arn"` 498 // Whether to associate a public IP address with an instance in a VPC. 499 AssociatePublicIpAddress *bool `pulumi:"associatePublicIpAddress"` 500 // AZ to start the instance in. 501 AvailabilityZone *string `pulumi:"availabilityZone"` 502 // Describes an instance's Capacity Reservation targeting option. See Capacity Reservation Specification below for more details. 503 // 504 // > **NOTE:** Changing `cpuCoreCount` and/or `cpuThreadsPerCore` will cause the resource to be destroyed and re-created. 505 CapacityReservationSpecification *InstanceCapacityReservationSpecification `pulumi:"capacityReservationSpecification"` 506 // Sets the number of CPU cores for an instance. This option is only supported on creation of instance type that support CPU Options [CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API. 507 // 508 // Deprecated: use 'cpu_options' argument instead 509 CpuCoreCount *int `pulumi:"cpuCoreCount"` 510 // The CPU options for the instance. See CPU Options below for more details. 511 CpuOptions *InstanceCpuOptions `pulumi:"cpuOptions"` 512 // If set to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information. 513 // 514 // Deprecated: use 'cpu_options' argument instead 515 CpuThreadsPerCore *int `pulumi:"cpuThreadsPerCore"` 516 // Configuration block for customizing the credit specification of the instance. See Credit Specification below for more details. This provider will only perform drift detection of its value when present in a configuration. Removing this configuration on existing instances will only stop managing it. It will not change the configuration back to the default for the instance type. 517 CreditSpecification *InstanceCreditSpecification `pulumi:"creditSpecification"` 518 // If true, enables [EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection). 519 DisableApiStop *bool `pulumi:"disableApiStop"` 520 // If true, enables [EC2 Instance Termination Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination). 521 DisableApiTermination *bool `pulumi:"disableApiTermination"` 522 // One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects. 523 EbsBlockDevices []InstanceEbsBlockDevice `pulumi:"ebsBlockDevices"` 524 // If true, the launched EC2 instance will be EBS-optimized. Note that if this is not set on an instance type that is optimized by default then this will show as disabled but if the instance type is optimized by default then there is no need to set this and there is no effect to disabling it. See the [EBS Optimized section](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) of the AWS User Guide for more information. 525 EbsOptimized *bool `pulumi:"ebsOptimized"` 526 // Enable Nitro Enclaves on launched instances. See Enclave Options below for more details. 527 EnclaveOptions *InstanceEnclaveOptions `pulumi:"enclaveOptions"` 528 // One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects. 529 EphemeralBlockDevices []InstanceEphemeralBlockDevice `pulumi:"ephemeralBlockDevices"` 530 // If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `passwordData` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. 531 GetPasswordData *bool `pulumi:"getPasswordData"` 532 // If true, the launched EC2 instance will support hibernation. 533 Hibernation *bool `pulumi:"hibernation"` 534 // ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host. 535 HostId *string `pulumi:"hostId"` 536 // ARN of the host resource group in which to launch the instances. If you specify an ARN, omit the `tenancy` parameter or set it to `host`. 537 HostResourceGroupArn *string `pulumi:"hostResourceGroupArn"` 538 // IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. Ensure your credentials have the correct permission to assign the instance profile according to the [EC2 documentation](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html#roles-usingrole-ec2instance-permissions), notably `iam:PassRole`. 539 IamInstanceProfile interface{} `pulumi:"iamInstanceProfile"` 540 // Shutdown behavior for the instance. Amazon defaults this to `stop` for EBS-backed instances and `terminate` for instance-store instances. Cannot be set on instance-store instances. See [Shutdown Behavior](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior) for more information. 541 InstanceInitiatedShutdownBehavior *string `pulumi:"instanceInitiatedShutdownBehavior"` 542 // Indicates whether this is a Spot Instance or a Scheduled Instance. 543 InstanceLifecycle *string `pulumi:"instanceLifecycle"` 544 // Describes the market (purchasing) option for the instances. See Market Options below for details on attributes. 545 InstanceMarketOptions *InstanceInstanceMarketOptions `pulumi:"instanceMarketOptions"` 546 // State of the instance. One of: `pending`, `running`, `shutting-down`, `terminated`, `stopping`, `stopped`. See [Instance Lifecycle](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) for more information. 547 InstanceState *string `pulumi:"instanceState"` 548 // Instance type to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifies an instance type. If an instance type is specified in the Launch Template, setting `instanceType` will override the instance type specified in the Launch Template. Updates to this field will trigger a stop/start of the EC2 instance. 549 InstanceType *string `pulumi:"instanceType"` 550 // Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. 551 Ipv6AddressCount *int `pulumi:"ipv6AddressCount"` 552 // Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface 553 Ipv6Addresses []string `pulumi:"ipv6Addresses"` 554 // Key name of the Key Pair to use for the instance; which can be managed using the `ec2.KeyPair` resource. 555 KeyName *string `pulumi:"keyName"` 556 // Specifies a Launch Template to configure the instance. Parameters configured on this resource will override the corresponding parameters in the Launch Template. See Launch Template Specification below for more details. 557 LaunchTemplate *InstanceLaunchTemplate `pulumi:"launchTemplate"` 558 // Maintenance and recovery options for the instance. See Maintenance Options below for more details. 559 MaintenanceOptions *InstanceMaintenanceOptions `pulumi:"maintenanceOptions"` 560 // Customize the metadata options of the instance. See Metadata Options below for more details. 561 MetadataOptions *InstanceMetadataOptions `pulumi:"metadataOptions"` 562 // If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0) 563 Monitoring *bool `pulumi:"monitoring"` 564 // Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details. 565 NetworkInterfaces []InstanceNetworkInterface `pulumi:"networkInterfaces"` 566 // ARN of the Outpost the instance is assigned to. 567 OutpostArn *string `pulumi:"outpostArn"` 568 // Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if `getPasswordData` is true. Note that this encrypted value will be stored in the state file, as with all exported attributes. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. 569 PasswordData *string `pulumi:"passwordData"` 570 // Placement Group to start the instance in. 571 PlacementGroup *string `pulumi:"placementGroup"` 572 // Number of the partition the instance is in. Valid only if the `ec2.PlacementGroup` resource's `strategy` argument is set to `"partition"`. 573 PlacementPartitionNumber *int `pulumi:"placementPartitionNumber"` 574 // ID of the instance's primary network interface. 575 PrimaryNetworkInterfaceId *string `pulumi:"primaryNetworkInterfaceId"` 576 // Private DNS name assigned to the instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC. 577 PrivateDns *string `pulumi:"privateDns"` 578 // Options for the instance hostname. The default values are inherited from the subnet. See Private DNS Name Options below for more details. 579 PrivateDnsNameOptions *InstancePrivateDnsNameOptions `pulumi:"privateDnsNameOptions"` 580 // Private IP address to associate with the instance in a VPC. 581 PrivateIp *string `pulumi:"privateIp"` 582 // Public DNS name assigned to the instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC. 583 PublicDns *string `pulumi:"publicDns"` 584 // Public IP address assigned to the instance, if applicable. **NOTE**: If you are using an `ec2.Eip` with your instance, you should refer to the EIP's address directly and not use `publicIp` as this field will change after the EIP is attached. 585 PublicIp *string `pulumi:"publicIp"` 586 // Configuration block to customize details about the root block device of the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a list containing one object. 587 RootBlockDevice *InstanceRootBlockDevice `pulumi:"rootBlockDevice"` 588 // List of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e., referenced in a `networkInterface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type. 589 SecondaryPrivateIps []string `pulumi:"secondaryPrivateIps"` 590 // List of security group names to associate with. 591 // 592 // > **NOTE:** If you are creating Instances in a VPC, use `vpcSecurityGroupIds` instead. 593 // 594 // Deprecated: Use of `securityGroups` is discouraged as it does not allow for changes and will force your instance to be replaced if changes are made. To avoid this, use `vpcSecurityGroupIds` which allows for updates. 595 SecurityGroups []string `pulumi:"securityGroups"` 596 // Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. Defaults true. 597 SourceDestCheck *bool `pulumi:"sourceDestCheck"` 598 // If the request is a Spot Instance request, the ID of the request. 599 SpotInstanceRequestId *string `pulumi:"spotInstanceRequestId"` 600 // VPC Subnet ID to launch in. 601 SubnetId *string `pulumi:"subnetId"` 602 // Map of tags to assign to the resource. Note that these tags apply to the instance and not block storage devices. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 603 Tags map[string]string `pulumi:"tags"` 604 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 605 // 606 // Deprecated: Please use `tags` instead. 607 TagsAll map[string]string `pulumi:"tagsAll"` 608 // Tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of `dedicated` runs on single-tenant hardware. The `host` tenancy is not supported for the import-instance command. Valid values are `default`, `dedicated`, and `host`. 609 Tenancy *string `pulumi:"tenancy"` 610 // User data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `userDataBase64` instead. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. 611 UserData *string `pulumi:"userData"` 612 // Can be used instead of `userData` to pass base64-encoded binary data directly. Use this instead of `userData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. 613 UserDataBase64 *string `pulumi:"userDataBase64"` 614 // When used in combination with `userData` or `userDataBase64` will trigger a destroy and recreate when set to `true`. Defaults to `false` if not set. 615 UserDataReplaceOnChange *bool `pulumi:"userDataReplaceOnChange"` 616 // Map of tags to assign, at instance-creation time, to root and EBS volumes. 617 // 618 // > **NOTE:** Do not use `volumeTags` if you plan to manage block device tags outside the `ec2.Instance` configuration, such as using `tags` in an `ebs.Volume` resource attached via `ec2.VolumeAttachment`. Doing so will result in resource cycling and inconsistent behavior. 619 VolumeTags map[string]string `pulumi:"volumeTags"` 620 // List of security group IDs to associate with. 621 VpcSecurityGroupIds []string `pulumi:"vpcSecurityGroupIds"` 622 } 623 624 type InstanceState struct { 625 // AMI to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifes an AMI. If an AMI is specified in the Launch Template, setting `ami` will override the AMI specified in the Launch Template. 626 Ami pulumi.StringPtrInput 627 // ARN of the instance. 628 Arn pulumi.StringPtrInput 629 // Whether to associate a public IP address with an instance in a VPC. 630 AssociatePublicIpAddress pulumi.BoolPtrInput 631 // AZ to start the instance in. 632 AvailabilityZone pulumi.StringPtrInput 633 // Describes an instance's Capacity Reservation targeting option. See Capacity Reservation Specification below for more details. 634 // 635 // > **NOTE:** Changing `cpuCoreCount` and/or `cpuThreadsPerCore` will cause the resource to be destroyed and re-created. 636 CapacityReservationSpecification InstanceCapacityReservationSpecificationPtrInput 637 // Sets the number of CPU cores for an instance. This option is only supported on creation of instance type that support CPU Options [CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API. 638 // 639 // Deprecated: use 'cpu_options' argument instead 640 CpuCoreCount pulumi.IntPtrInput 641 // The CPU options for the instance. See CPU Options below for more details. 642 CpuOptions InstanceCpuOptionsPtrInput 643 // If set to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information. 644 // 645 // Deprecated: use 'cpu_options' argument instead 646 CpuThreadsPerCore pulumi.IntPtrInput 647 // Configuration block for customizing the credit specification of the instance. See Credit Specification below for more details. This provider will only perform drift detection of its value when present in a configuration. Removing this configuration on existing instances will only stop managing it. It will not change the configuration back to the default for the instance type. 648 CreditSpecification InstanceCreditSpecificationPtrInput 649 // If true, enables [EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection). 650 DisableApiStop pulumi.BoolPtrInput 651 // If true, enables [EC2 Instance Termination Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination). 652 DisableApiTermination pulumi.BoolPtrInput 653 // One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects. 654 EbsBlockDevices InstanceEbsBlockDeviceArrayInput 655 // If true, the launched EC2 instance will be EBS-optimized. Note that if this is not set on an instance type that is optimized by default then this will show as disabled but if the instance type is optimized by default then there is no need to set this and there is no effect to disabling it. See the [EBS Optimized section](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) of the AWS User Guide for more information. 656 EbsOptimized pulumi.BoolPtrInput 657 // Enable Nitro Enclaves on launched instances. See Enclave Options below for more details. 658 EnclaveOptions InstanceEnclaveOptionsPtrInput 659 // One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects. 660 EphemeralBlockDevices InstanceEphemeralBlockDeviceArrayInput 661 // If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `passwordData` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. 662 GetPasswordData pulumi.BoolPtrInput 663 // If true, the launched EC2 instance will support hibernation. 664 Hibernation pulumi.BoolPtrInput 665 // ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host. 666 HostId pulumi.StringPtrInput 667 // ARN of the host resource group in which to launch the instances. If you specify an ARN, omit the `tenancy` parameter or set it to `host`. 668 HostResourceGroupArn pulumi.StringPtrInput 669 // IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. Ensure your credentials have the correct permission to assign the instance profile according to the [EC2 documentation](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html#roles-usingrole-ec2instance-permissions), notably `iam:PassRole`. 670 IamInstanceProfile pulumi.Input 671 // Shutdown behavior for the instance. Amazon defaults this to `stop` for EBS-backed instances and `terminate` for instance-store instances. Cannot be set on instance-store instances. See [Shutdown Behavior](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior) for more information. 672 InstanceInitiatedShutdownBehavior pulumi.StringPtrInput 673 // Indicates whether this is a Spot Instance or a Scheduled Instance. 674 InstanceLifecycle pulumi.StringPtrInput 675 // Describes the market (purchasing) option for the instances. See Market Options below for details on attributes. 676 InstanceMarketOptions InstanceInstanceMarketOptionsPtrInput 677 // State of the instance. One of: `pending`, `running`, `shutting-down`, `terminated`, `stopping`, `stopped`. See [Instance Lifecycle](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) for more information. 678 InstanceState pulumi.StringPtrInput 679 // Instance type to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifies an instance type. If an instance type is specified in the Launch Template, setting `instanceType` will override the instance type specified in the Launch Template. Updates to this field will trigger a stop/start of the EC2 instance. 680 InstanceType pulumi.StringPtrInput 681 // Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. 682 Ipv6AddressCount pulumi.IntPtrInput 683 // Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface 684 Ipv6Addresses pulumi.StringArrayInput 685 // Key name of the Key Pair to use for the instance; which can be managed using the `ec2.KeyPair` resource. 686 KeyName pulumi.StringPtrInput 687 // Specifies a Launch Template to configure the instance. Parameters configured on this resource will override the corresponding parameters in the Launch Template. See Launch Template Specification below for more details. 688 LaunchTemplate InstanceLaunchTemplatePtrInput 689 // Maintenance and recovery options for the instance. See Maintenance Options below for more details. 690 MaintenanceOptions InstanceMaintenanceOptionsPtrInput 691 // Customize the metadata options of the instance. See Metadata Options below for more details. 692 MetadataOptions InstanceMetadataOptionsPtrInput 693 // If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0) 694 Monitoring pulumi.BoolPtrInput 695 // Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details. 696 NetworkInterfaces InstanceNetworkInterfaceArrayInput 697 // ARN of the Outpost the instance is assigned to. 698 OutpostArn pulumi.StringPtrInput 699 // Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if `getPasswordData` is true. Note that this encrypted value will be stored in the state file, as with all exported attributes. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. 700 PasswordData pulumi.StringPtrInput 701 // Placement Group to start the instance in. 702 PlacementGroup pulumi.StringPtrInput 703 // Number of the partition the instance is in. Valid only if the `ec2.PlacementGroup` resource's `strategy` argument is set to `"partition"`. 704 PlacementPartitionNumber pulumi.IntPtrInput 705 // ID of the instance's primary network interface. 706 PrimaryNetworkInterfaceId pulumi.StringPtrInput 707 // Private DNS name assigned to the instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC. 708 PrivateDns pulumi.StringPtrInput 709 // Options for the instance hostname. The default values are inherited from the subnet. See Private DNS Name Options below for more details. 710 PrivateDnsNameOptions InstancePrivateDnsNameOptionsPtrInput 711 // Private IP address to associate with the instance in a VPC. 712 PrivateIp pulumi.StringPtrInput 713 // Public DNS name assigned to the instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC. 714 PublicDns pulumi.StringPtrInput 715 // Public IP address assigned to the instance, if applicable. **NOTE**: If you are using an `ec2.Eip` with your instance, you should refer to the EIP's address directly and not use `publicIp` as this field will change after the EIP is attached. 716 PublicIp pulumi.StringPtrInput 717 // Configuration block to customize details about the root block device of the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a list containing one object. 718 RootBlockDevice InstanceRootBlockDevicePtrInput 719 // List of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e., referenced in a `networkInterface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type. 720 SecondaryPrivateIps pulumi.StringArrayInput 721 // List of security group names to associate with. 722 // 723 // > **NOTE:** If you are creating Instances in a VPC, use `vpcSecurityGroupIds` instead. 724 // 725 // Deprecated: Use of `securityGroups` is discouraged as it does not allow for changes and will force your instance to be replaced if changes are made. To avoid this, use `vpcSecurityGroupIds` which allows for updates. 726 SecurityGroups pulumi.StringArrayInput 727 // Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. Defaults true. 728 SourceDestCheck pulumi.BoolPtrInput 729 // If the request is a Spot Instance request, the ID of the request. 730 SpotInstanceRequestId pulumi.StringPtrInput 731 // VPC Subnet ID to launch in. 732 SubnetId pulumi.StringPtrInput 733 // Map of tags to assign to the resource. Note that these tags apply to the instance and not block storage devices. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 734 Tags pulumi.StringMapInput 735 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 736 // 737 // Deprecated: Please use `tags` instead. 738 TagsAll pulumi.StringMapInput 739 // Tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of `dedicated` runs on single-tenant hardware. The `host` tenancy is not supported for the import-instance command. Valid values are `default`, `dedicated`, and `host`. 740 Tenancy pulumi.StringPtrInput 741 // User data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `userDataBase64` instead. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. 742 UserData pulumi.StringPtrInput 743 // Can be used instead of `userData` to pass base64-encoded binary data directly. Use this instead of `userData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. 744 UserDataBase64 pulumi.StringPtrInput 745 // When used in combination with `userData` or `userDataBase64` will trigger a destroy and recreate when set to `true`. Defaults to `false` if not set. 746 UserDataReplaceOnChange pulumi.BoolPtrInput 747 // Map of tags to assign, at instance-creation time, to root and EBS volumes. 748 // 749 // > **NOTE:** Do not use `volumeTags` if you plan to manage block device tags outside the `ec2.Instance` configuration, such as using `tags` in an `ebs.Volume` resource attached via `ec2.VolumeAttachment`. Doing so will result in resource cycling and inconsistent behavior. 750 VolumeTags pulumi.StringMapInput 751 // List of security group IDs to associate with. 752 VpcSecurityGroupIds pulumi.StringArrayInput 753 } 754 755 func (InstanceState) ElementType() reflect.Type { 756 return reflect.TypeOf((*instanceState)(nil)).Elem() 757 } 758 759 type instanceArgs struct { 760 // AMI to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifes an AMI. If an AMI is specified in the Launch Template, setting `ami` will override the AMI specified in the Launch Template. 761 Ami *string `pulumi:"ami"` 762 // Whether to associate a public IP address with an instance in a VPC. 763 AssociatePublicIpAddress *bool `pulumi:"associatePublicIpAddress"` 764 // AZ to start the instance in. 765 AvailabilityZone *string `pulumi:"availabilityZone"` 766 // Describes an instance's Capacity Reservation targeting option. See Capacity Reservation Specification below for more details. 767 // 768 // > **NOTE:** Changing `cpuCoreCount` and/or `cpuThreadsPerCore` will cause the resource to be destroyed and re-created. 769 CapacityReservationSpecification *InstanceCapacityReservationSpecification `pulumi:"capacityReservationSpecification"` 770 // Sets the number of CPU cores for an instance. This option is only supported on creation of instance type that support CPU Options [CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API. 771 // 772 // Deprecated: use 'cpu_options' argument instead 773 CpuCoreCount *int `pulumi:"cpuCoreCount"` 774 // The CPU options for the instance. See CPU Options below for more details. 775 CpuOptions *InstanceCpuOptions `pulumi:"cpuOptions"` 776 // If set to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information. 777 // 778 // Deprecated: use 'cpu_options' argument instead 779 CpuThreadsPerCore *int `pulumi:"cpuThreadsPerCore"` 780 // Configuration block for customizing the credit specification of the instance. See Credit Specification below for more details. This provider will only perform drift detection of its value when present in a configuration. Removing this configuration on existing instances will only stop managing it. It will not change the configuration back to the default for the instance type. 781 CreditSpecification *InstanceCreditSpecification `pulumi:"creditSpecification"` 782 // If true, enables [EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection). 783 DisableApiStop *bool `pulumi:"disableApiStop"` 784 // If true, enables [EC2 Instance Termination Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination). 785 DisableApiTermination *bool `pulumi:"disableApiTermination"` 786 // One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects. 787 EbsBlockDevices []InstanceEbsBlockDevice `pulumi:"ebsBlockDevices"` 788 // If true, the launched EC2 instance will be EBS-optimized. Note that if this is not set on an instance type that is optimized by default then this will show as disabled but if the instance type is optimized by default then there is no need to set this and there is no effect to disabling it. See the [EBS Optimized section](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) of the AWS User Guide for more information. 789 EbsOptimized *bool `pulumi:"ebsOptimized"` 790 // Enable Nitro Enclaves on launched instances. See Enclave Options below for more details. 791 EnclaveOptions *InstanceEnclaveOptions `pulumi:"enclaveOptions"` 792 // One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects. 793 EphemeralBlockDevices []InstanceEphemeralBlockDevice `pulumi:"ephemeralBlockDevices"` 794 // If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `passwordData` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. 795 GetPasswordData *bool `pulumi:"getPasswordData"` 796 // If true, the launched EC2 instance will support hibernation. 797 Hibernation *bool `pulumi:"hibernation"` 798 // ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host. 799 HostId *string `pulumi:"hostId"` 800 // ARN of the host resource group in which to launch the instances. If you specify an ARN, omit the `tenancy` parameter or set it to `host`. 801 HostResourceGroupArn *string `pulumi:"hostResourceGroupArn"` 802 // IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. Ensure your credentials have the correct permission to assign the instance profile according to the [EC2 documentation](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html#roles-usingrole-ec2instance-permissions), notably `iam:PassRole`. 803 IamInstanceProfile interface{} `pulumi:"iamInstanceProfile"` 804 // Shutdown behavior for the instance. Amazon defaults this to `stop` for EBS-backed instances and `terminate` for instance-store instances. Cannot be set on instance-store instances. See [Shutdown Behavior](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior) for more information. 805 InstanceInitiatedShutdownBehavior *string `pulumi:"instanceInitiatedShutdownBehavior"` 806 // Describes the market (purchasing) option for the instances. See Market Options below for details on attributes. 807 InstanceMarketOptions *InstanceInstanceMarketOptions `pulumi:"instanceMarketOptions"` 808 // Instance type to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifies an instance type. If an instance type is specified in the Launch Template, setting `instanceType` will override the instance type specified in the Launch Template. Updates to this field will trigger a stop/start of the EC2 instance. 809 InstanceType *string `pulumi:"instanceType"` 810 // Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. 811 Ipv6AddressCount *int `pulumi:"ipv6AddressCount"` 812 // Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface 813 Ipv6Addresses []string `pulumi:"ipv6Addresses"` 814 // Key name of the Key Pair to use for the instance; which can be managed using the `ec2.KeyPair` resource. 815 KeyName *string `pulumi:"keyName"` 816 // Specifies a Launch Template to configure the instance. Parameters configured on this resource will override the corresponding parameters in the Launch Template. See Launch Template Specification below for more details. 817 LaunchTemplate *InstanceLaunchTemplate `pulumi:"launchTemplate"` 818 // Maintenance and recovery options for the instance. See Maintenance Options below for more details. 819 MaintenanceOptions *InstanceMaintenanceOptions `pulumi:"maintenanceOptions"` 820 // Customize the metadata options of the instance. See Metadata Options below for more details. 821 MetadataOptions *InstanceMetadataOptions `pulumi:"metadataOptions"` 822 // If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0) 823 Monitoring *bool `pulumi:"monitoring"` 824 // Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details. 825 NetworkInterfaces []InstanceNetworkInterface `pulumi:"networkInterfaces"` 826 // Placement Group to start the instance in. 827 PlacementGroup *string `pulumi:"placementGroup"` 828 // Number of the partition the instance is in. Valid only if the `ec2.PlacementGroup` resource's `strategy` argument is set to `"partition"`. 829 PlacementPartitionNumber *int `pulumi:"placementPartitionNumber"` 830 // Options for the instance hostname. The default values are inherited from the subnet. See Private DNS Name Options below for more details. 831 PrivateDnsNameOptions *InstancePrivateDnsNameOptions `pulumi:"privateDnsNameOptions"` 832 // Private IP address to associate with the instance in a VPC. 833 PrivateIp *string `pulumi:"privateIp"` 834 // Configuration block to customize details about the root block device of the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a list containing one object. 835 RootBlockDevice *InstanceRootBlockDevice `pulumi:"rootBlockDevice"` 836 // List of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e., referenced in a `networkInterface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type. 837 SecondaryPrivateIps []string `pulumi:"secondaryPrivateIps"` 838 // List of security group names to associate with. 839 // 840 // > **NOTE:** If you are creating Instances in a VPC, use `vpcSecurityGroupIds` instead. 841 // 842 // Deprecated: Use of `securityGroups` is discouraged as it does not allow for changes and will force your instance to be replaced if changes are made. To avoid this, use `vpcSecurityGroupIds` which allows for updates. 843 SecurityGroups []string `pulumi:"securityGroups"` 844 // Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. Defaults true. 845 SourceDestCheck *bool `pulumi:"sourceDestCheck"` 846 // VPC Subnet ID to launch in. 847 SubnetId *string `pulumi:"subnetId"` 848 // Map of tags to assign to the resource. Note that these tags apply to the instance and not block storage devices. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 849 Tags map[string]string `pulumi:"tags"` 850 // Tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of `dedicated` runs on single-tenant hardware. The `host` tenancy is not supported for the import-instance command. Valid values are `default`, `dedicated`, and `host`. 851 Tenancy *string `pulumi:"tenancy"` 852 // User data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `userDataBase64` instead. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. 853 UserData *string `pulumi:"userData"` 854 // Can be used instead of `userData` to pass base64-encoded binary data directly. Use this instead of `userData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. 855 UserDataBase64 *string `pulumi:"userDataBase64"` 856 // When used in combination with `userData` or `userDataBase64` will trigger a destroy and recreate when set to `true`. Defaults to `false` if not set. 857 UserDataReplaceOnChange *bool `pulumi:"userDataReplaceOnChange"` 858 // Map of tags to assign, at instance-creation time, to root and EBS volumes. 859 // 860 // > **NOTE:** Do not use `volumeTags` if you plan to manage block device tags outside the `ec2.Instance` configuration, such as using `tags` in an `ebs.Volume` resource attached via `ec2.VolumeAttachment`. Doing so will result in resource cycling and inconsistent behavior. 861 VolumeTags map[string]string `pulumi:"volumeTags"` 862 // List of security group IDs to associate with. 863 VpcSecurityGroupIds []string `pulumi:"vpcSecurityGroupIds"` 864 } 865 866 // The set of arguments for constructing a Instance resource. 867 type InstanceArgs struct { 868 // AMI to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifes an AMI. If an AMI is specified in the Launch Template, setting `ami` will override the AMI specified in the Launch Template. 869 Ami pulumi.StringPtrInput 870 // Whether to associate a public IP address with an instance in a VPC. 871 AssociatePublicIpAddress pulumi.BoolPtrInput 872 // AZ to start the instance in. 873 AvailabilityZone pulumi.StringPtrInput 874 // Describes an instance's Capacity Reservation targeting option. See Capacity Reservation Specification below for more details. 875 // 876 // > **NOTE:** Changing `cpuCoreCount` and/or `cpuThreadsPerCore` will cause the resource to be destroyed and re-created. 877 CapacityReservationSpecification InstanceCapacityReservationSpecificationPtrInput 878 // Sets the number of CPU cores for an instance. This option is only supported on creation of instance type that support CPU Options [CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API. 879 // 880 // Deprecated: use 'cpu_options' argument instead 881 CpuCoreCount pulumi.IntPtrInput 882 // The CPU options for the instance. See CPU Options below for more details. 883 CpuOptions InstanceCpuOptionsPtrInput 884 // If set to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information. 885 // 886 // Deprecated: use 'cpu_options' argument instead 887 CpuThreadsPerCore pulumi.IntPtrInput 888 // Configuration block for customizing the credit specification of the instance. See Credit Specification below for more details. This provider will only perform drift detection of its value when present in a configuration. Removing this configuration on existing instances will only stop managing it. It will not change the configuration back to the default for the instance type. 889 CreditSpecification InstanceCreditSpecificationPtrInput 890 // If true, enables [EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection). 891 DisableApiStop pulumi.BoolPtrInput 892 // If true, enables [EC2 Instance Termination Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination). 893 DisableApiTermination pulumi.BoolPtrInput 894 // One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects. 895 EbsBlockDevices InstanceEbsBlockDeviceArrayInput 896 // If true, the launched EC2 instance will be EBS-optimized. Note that if this is not set on an instance type that is optimized by default then this will show as disabled but if the instance type is optimized by default then there is no need to set this and there is no effect to disabling it. See the [EBS Optimized section](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) of the AWS User Guide for more information. 897 EbsOptimized pulumi.BoolPtrInput 898 // Enable Nitro Enclaves on launched instances. See Enclave Options below for more details. 899 EnclaveOptions InstanceEnclaveOptionsPtrInput 900 // One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects. 901 EphemeralBlockDevices InstanceEphemeralBlockDeviceArrayInput 902 // If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `passwordData` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. 903 GetPasswordData pulumi.BoolPtrInput 904 // If true, the launched EC2 instance will support hibernation. 905 Hibernation pulumi.BoolPtrInput 906 // ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host. 907 HostId pulumi.StringPtrInput 908 // ARN of the host resource group in which to launch the instances. If you specify an ARN, omit the `tenancy` parameter or set it to `host`. 909 HostResourceGroupArn pulumi.StringPtrInput 910 // IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. Ensure your credentials have the correct permission to assign the instance profile according to the [EC2 documentation](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html#roles-usingrole-ec2instance-permissions), notably `iam:PassRole`. 911 IamInstanceProfile pulumi.Input 912 // Shutdown behavior for the instance. Amazon defaults this to `stop` for EBS-backed instances and `terminate` for instance-store instances. Cannot be set on instance-store instances. See [Shutdown Behavior](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior) for more information. 913 InstanceInitiatedShutdownBehavior pulumi.StringPtrInput 914 // Describes the market (purchasing) option for the instances. See Market Options below for details on attributes. 915 InstanceMarketOptions InstanceInstanceMarketOptionsPtrInput 916 // Instance type to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifies an instance type. If an instance type is specified in the Launch Template, setting `instanceType` will override the instance type specified in the Launch Template. Updates to this field will trigger a stop/start of the EC2 instance. 917 InstanceType pulumi.StringPtrInput 918 // Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. 919 Ipv6AddressCount pulumi.IntPtrInput 920 // Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface 921 Ipv6Addresses pulumi.StringArrayInput 922 // Key name of the Key Pair to use for the instance; which can be managed using the `ec2.KeyPair` resource. 923 KeyName pulumi.StringPtrInput 924 // Specifies a Launch Template to configure the instance. Parameters configured on this resource will override the corresponding parameters in the Launch Template. See Launch Template Specification below for more details. 925 LaunchTemplate InstanceLaunchTemplatePtrInput 926 // Maintenance and recovery options for the instance. See Maintenance Options below for more details. 927 MaintenanceOptions InstanceMaintenanceOptionsPtrInput 928 // Customize the metadata options of the instance. See Metadata Options below for more details. 929 MetadataOptions InstanceMetadataOptionsPtrInput 930 // If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0) 931 Monitoring pulumi.BoolPtrInput 932 // Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details. 933 NetworkInterfaces InstanceNetworkInterfaceArrayInput 934 // Placement Group to start the instance in. 935 PlacementGroup pulumi.StringPtrInput 936 // Number of the partition the instance is in. Valid only if the `ec2.PlacementGroup` resource's `strategy` argument is set to `"partition"`. 937 PlacementPartitionNumber pulumi.IntPtrInput 938 // Options for the instance hostname. The default values are inherited from the subnet. See Private DNS Name Options below for more details. 939 PrivateDnsNameOptions InstancePrivateDnsNameOptionsPtrInput 940 // Private IP address to associate with the instance in a VPC. 941 PrivateIp pulumi.StringPtrInput 942 // Configuration block to customize details about the root block device of the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a list containing one object. 943 RootBlockDevice InstanceRootBlockDevicePtrInput 944 // List of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e., referenced in a `networkInterface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type. 945 SecondaryPrivateIps pulumi.StringArrayInput 946 // List of security group names to associate with. 947 // 948 // > **NOTE:** If you are creating Instances in a VPC, use `vpcSecurityGroupIds` instead. 949 // 950 // Deprecated: Use of `securityGroups` is discouraged as it does not allow for changes and will force your instance to be replaced if changes are made. To avoid this, use `vpcSecurityGroupIds` which allows for updates. 951 SecurityGroups pulumi.StringArrayInput 952 // Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. Defaults true. 953 SourceDestCheck pulumi.BoolPtrInput 954 // VPC Subnet ID to launch in. 955 SubnetId pulumi.StringPtrInput 956 // Map of tags to assign to the resource. Note that these tags apply to the instance and not block storage devices. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 957 Tags pulumi.StringMapInput 958 // Tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of `dedicated` runs on single-tenant hardware. The `host` tenancy is not supported for the import-instance command. Valid values are `default`, `dedicated`, and `host`. 959 Tenancy pulumi.StringPtrInput 960 // User data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `userDataBase64` instead. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. 961 UserData pulumi.StringPtrInput 962 // Can be used instead of `userData` to pass base64-encoded binary data directly. Use this instead of `userData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. 963 UserDataBase64 pulumi.StringPtrInput 964 // When used in combination with `userData` or `userDataBase64` will trigger a destroy and recreate when set to `true`. Defaults to `false` if not set. 965 UserDataReplaceOnChange pulumi.BoolPtrInput 966 // Map of tags to assign, at instance-creation time, to root and EBS volumes. 967 // 968 // > **NOTE:** Do not use `volumeTags` if you plan to manage block device tags outside the `ec2.Instance` configuration, such as using `tags` in an `ebs.Volume` resource attached via `ec2.VolumeAttachment`. Doing so will result in resource cycling and inconsistent behavior. 969 VolumeTags pulumi.StringMapInput 970 // List of security group IDs to associate with. 971 VpcSecurityGroupIds pulumi.StringArrayInput 972 } 973 974 func (InstanceArgs) ElementType() reflect.Type { 975 return reflect.TypeOf((*instanceArgs)(nil)).Elem() 976 } 977 978 type InstanceInput interface { 979 pulumi.Input 980 981 ToInstanceOutput() InstanceOutput 982 ToInstanceOutputWithContext(ctx context.Context) InstanceOutput 983 } 984 985 func (*Instance) ElementType() reflect.Type { 986 return reflect.TypeOf((**Instance)(nil)).Elem() 987 } 988 989 func (i *Instance) ToInstanceOutput() InstanceOutput { 990 return i.ToInstanceOutputWithContext(context.Background()) 991 } 992 993 func (i *Instance) ToInstanceOutputWithContext(ctx context.Context) InstanceOutput { 994 return pulumi.ToOutputWithContext(ctx, i).(InstanceOutput) 995 } 996 997 // InstanceArrayInput is an input type that accepts InstanceArray and InstanceArrayOutput values. 998 // You can construct a concrete instance of `InstanceArrayInput` via: 999 // 1000 // InstanceArray{ InstanceArgs{...} } 1001 type InstanceArrayInput interface { 1002 pulumi.Input 1003 1004 ToInstanceArrayOutput() InstanceArrayOutput 1005 ToInstanceArrayOutputWithContext(context.Context) InstanceArrayOutput 1006 } 1007 1008 type InstanceArray []InstanceInput 1009 1010 func (InstanceArray) ElementType() reflect.Type { 1011 return reflect.TypeOf((*[]*Instance)(nil)).Elem() 1012 } 1013 1014 func (i InstanceArray) ToInstanceArrayOutput() InstanceArrayOutput { 1015 return i.ToInstanceArrayOutputWithContext(context.Background()) 1016 } 1017 1018 func (i InstanceArray) ToInstanceArrayOutputWithContext(ctx context.Context) InstanceArrayOutput { 1019 return pulumi.ToOutputWithContext(ctx, i).(InstanceArrayOutput) 1020 } 1021 1022 // InstanceMapInput is an input type that accepts InstanceMap and InstanceMapOutput values. 1023 // You can construct a concrete instance of `InstanceMapInput` via: 1024 // 1025 // InstanceMap{ "key": InstanceArgs{...} } 1026 type InstanceMapInput interface { 1027 pulumi.Input 1028 1029 ToInstanceMapOutput() InstanceMapOutput 1030 ToInstanceMapOutputWithContext(context.Context) InstanceMapOutput 1031 } 1032 1033 type InstanceMap map[string]InstanceInput 1034 1035 func (InstanceMap) ElementType() reflect.Type { 1036 return reflect.TypeOf((*map[string]*Instance)(nil)).Elem() 1037 } 1038 1039 func (i InstanceMap) ToInstanceMapOutput() InstanceMapOutput { 1040 return i.ToInstanceMapOutputWithContext(context.Background()) 1041 } 1042 1043 func (i InstanceMap) ToInstanceMapOutputWithContext(ctx context.Context) InstanceMapOutput { 1044 return pulumi.ToOutputWithContext(ctx, i).(InstanceMapOutput) 1045 } 1046 1047 type InstanceOutput struct{ *pulumi.OutputState } 1048 1049 func (InstanceOutput) ElementType() reflect.Type { 1050 return reflect.TypeOf((**Instance)(nil)).Elem() 1051 } 1052 1053 func (o InstanceOutput) ToInstanceOutput() InstanceOutput { 1054 return o 1055 } 1056 1057 func (o InstanceOutput) ToInstanceOutputWithContext(ctx context.Context) InstanceOutput { 1058 return o 1059 } 1060 1061 // AMI to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifes an AMI. If an AMI is specified in the Launch Template, setting `ami` will override the AMI specified in the Launch Template. 1062 func (o InstanceOutput) Ami() pulumi.StringOutput { 1063 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Ami }).(pulumi.StringOutput) 1064 } 1065 1066 // ARN of the instance. 1067 func (o InstanceOutput) Arn() pulumi.StringOutput { 1068 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Arn }).(pulumi.StringOutput) 1069 } 1070 1071 // Whether to associate a public IP address with an instance in a VPC. 1072 func (o InstanceOutput) AssociatePublicIpAddress() pulumi.BoolOutput { 1073 return o.ApplyT(func(v *Instance) pulumi.BoolOutput { return v.AssociatePublicIpAddress }).(pulumi.BoolOutput) 1074 } 1075 1076 // AZ to start the instance in. 1077 func (o InstanceOutput) AvailabilityZone() pulumi.StringOutput { 1078 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.AvailabilityZone }).(pulumi.StringOutput) 1079 } 1080 1081 // Describes an instance's Capacity Reservation targeting option. See Capacity Reservation Specification below for more details. 1082 // 1083 // > **NOTE:** Changing `cpuCoreCount` and/or `cpuThreadsPerCore` will cause the resource to be destroyed and re-created. 1084 func (o InstanceOutput) CapacityReservationSpecification() InstanceCapacityReservationSpecificationOutput { 1085 return o.ApplyT(func(v *Instance) InstanceCapacityReservationSpecificationOutput { 1086 return v.CapacityReservationSpecification 1087 }).(InstanceCapacityReservationSpecificationOutput) 1088 } 1089 1090 // Sets the number of CPU cores for an instance. This option is only supported on creation of instance type that support CPU Options [CPU Cores and Threads Per CPU Core Per Instance Type](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html#cpu-options-supported-instances-values) - specifying this option for unsupported instance types will return an error from the EC2 API. 1091 // 1092 // Deprecated: use 'cpu_options' argument instead 1093 func (o InstanceOutput) CpuCoreCount() pulumi.IntOutput { 1094 return o.ApplyT(func(v *Instance) pulumi.IntOutput { return v.CpuCoreCount }).(pulumi.IntOutput) 1095 } 1096 1097 // The CPU options for the instance. See CPU Options below for more details. 1098 func (o InstanceOutput) CpuOptions() InstanceCpuOptionsOutput { 1099 return o.ApplyT(func(v *Instance) InstanceCpuOptionsOutput { return v.CpuOptions }).(InstanceCpuOptionsOutput) 1100 } 1101 1102 // If set to 1, hyperthreading is disabled on the launched instance. Defaults to 2 if not set. See [Optimizing CPU Options](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-optimize-cpu.html) for more information. 1103 // 1104 // Deprecated: use 'cpu_options' argument instead 1105 func (o InstanceOutput) CpuThreadsPerCore() pulumi.IntOutput { 1106 return o.ApplyT(func(v *Instance) pulumi.IntOutput { return v.CpuThreadsPerCore }).(pulumi.IntOutput) 1107 } 1108 1109 // Configuration block for customizing the credit specification of the instance. See Credit Specification below for more details. This provider will only perform drift detection of its value when present in a configuration. Removing this configuration on existing instances will only stop managing it. It will not change the configuration back to the default for the instance type. 1110 func (o InstanceOutput) CreditSpecification() InstanceCreditSpecificationPtrOutput { 1111 return o.ApplyT(func(v *Instance) InstanceCreditSpecificationPtrOutput { return v.CreditSpecification }).(InstanceCreditSpecificationPtrOutput) 1112 } 1113 1114 // If true, enables [EC2 Instance Stop Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html#Using_StopProtection). 1115 func (o InstanceOutput) DisableApiStop() pulumi.BoolOutput { 1116 return o.ApplyT(func(v *Instance) pulumi.BoolOutput { return v.DisableApiStop }).(pulumi.BoolOutput) 1117 } 1118 1119 // If true, enables [EC2 Instance Termination Protection](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingDisableAPITermination). 1120 func (o InstanceOutput) DisableApiTermination() pulumi.BoolOutput { 1121 return o.ApplyT(func(v *Instance) pulumi.BoolOutput { return v.DisableApiTermination }).(pulumi.BoolOutput) 1122 } 1123 1124 // One or more configuration blocks with additional EBS block devices to attach to the instance. Block device configurations only apply on resource creation. See Block Devices below for details on attributes and drift detection. When accessing this as an attribute reference, it is a set of objects. 1125 func (o InstanceOutput) EbsBlockDevices() InstanceEbsBlockDeviceArrayOutput { 1126 return o.ApplyT(func(v *Instance) InstanceEbsBlockDeviceArrayOutput { return v.EbsBlockDevices }).(InstanceEbsBlockDeviceArrayOutput) 1127 } 1128 1129 // If true, the launched EC2 instance will be EBS-optimized. Note that if this is not set on an instance type that is optimized by default then this will show as disabled but if the instance type is optimized by default then there is no need to set this and there is no effect to disabling it. See the [EBS Optimized section](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) of the AWS User Guide for more information. 1130 func (o InstanceOutput) EbsOptimized() pulumi.BoolOutput { 1131 return o.ApplyT(func(v *Instance) pulumi.BoolOutput { return v.EbsOptimized }).(pulumi.BoolOutput) 1132 } 1133 1134 // Enable Nitro Enclaves on launched instances. See Enclave Options below for more details. 1135 func (o InstanceOutput) EnclaveOptions() InstanceEnclaveOptionsOutput { 1136 return o.ApplyT(func(v *Instance) InstanceEnclaveOptionsOutput { return v.EnclaveOptions }).(InstanceEnclaveOptionsOutput) 1137 } 1138 1139 // One or more configuration blocks to customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a set of objects. 1140 func (o InstanceOutput) EphemeralBlockDevices() InstanceEphemeralBlockDeviceArrayOutput { 1141 return o.ApplyT(func(v *Instance) InstanceEphemeralBlockDeviceArrayOutput { return v.EphemeralBlockDevices }).(InstanceEphemeralBlockDeviceArrayOutput) 1142 } 1143 1144 // If true, wait for password data to become available and retrieve it. Useful for getting the administrator password for instances running Microsoft Windows. The password data is exported to the `passwordData` attribute. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. 1145 func (o InstanceOutput) GetPasswordData() pulumi.BoolPtrOutput { 1146 return o.ApplyT(func(v *Instance) pulumi.BoolPtrOutput { return v.GetPasswordData }).(pulumi.BoolPtrOutput) 1147 } 1148 1149 // If true, the launched EC2 instance will support hibernation. 1150 func (o InstanceOutput) Hibernation() pulumi.BoolPtrOutput { 1151 return o.ApplyT(func(v *Instance) pulumi.BoolPtrOutput { return v.Hibernation }).(pulumi.BoolPtrOutput) 1152 } 1153 1154 // ID of a dedicated host that the instance will be assigned to. Use when an instance is to be launched on a specific dedicated host. 1155 func (o InstanceOutput) HostId() pulumi.StringOutput { 1156 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.HostId }).(pulumi.StringOutput) 1157 } 1158 1159 // ARN of the host resource group in which to launch the instances. If you specify an ARN, omit the `tenancy` parameter or set it to `host`. 1160 func (o InstanceOutput) HostResourceGroupArn() pulumi.StringOutput { 1161 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.HostResourceGroupArn }).(pulumi.StringOutput) 1162 } 1163 1164 // IAM Instance Profile to launch the instance with. Specified as the name of the Instance Profile. Ensure your credentials have the correct permission to assign the instance profile according to the [EC2 documentation](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html#roles-usingrole-ec2instance-permissions), notably `iam:PassRole`. 1165 func (o InstanceOutput) IamInstanceProfile() pulumi.StringOutput { 1166 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.IamInstanceProfile }).(pulumi.StringOutput) 1167 } 1168 1169 // Shutdown behavior for the instance. Amazon defaults this to `stop` for EBS-backed instances and `terminate` for instance-store instances. Cannot be set on instance-store instances. See [Shutdown Behavior](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#Using_ChangingInstanceInitiatedShutdownBehavior) for more information. 1170 func (o InstanceOutput) InstanceInitiatedShutdownBehavior() pulumi.StringOutput { 1171 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.InstanceInitiatedShutdownBehavior }).(pulumi.StringOutput) 1172 } 1173 1174 // Indicates whether this is a Spot Instance or a Scheduled Instance. 1175 func (o InstanceOutput) InstanceLifecycle() pulumi.StringOutput { 1176 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.InstanceLifecycle }).(pulumi.StringOutput) 1177 } 1178 1179 // Describes the market (purchasing) option for the instances. See Market Options below for details on attributes. 1180 func (o InstanceOutput) InstanceMarketOptions() InstanceInstanceMarketOptionsOutput { 1181 return o.ApplyT(func(v *Instance) InstanceInstanceMarketOptionsOutput { return v.InstanceMarketOptions }).(InstanceInstanceMarketOptionsOutput) 1182 } 1183 1184 // State of the instance. One of: `pending`, `running`, `shutting-down`, `terminated`, `stopping`, `stopped`. See [Instance Lifecycle](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) for more information. 1185 func (o InstanceOutput) InstanceState() pulumi.StringOutput { 1186 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.InstanceState }).(pulumi.StringOutput) 1187 } 1188 1189 // Instance type to use for the instance. Required unless `launchTemplate` is specified and the Launch Template specifies an instance type. If an instance type is specified in the Launch Template, setting `instanceType` will override the instance type specified in the Launch Template. Updates to this field will trigger a stop/start of the EC2 instance. 1190 func (o InstanceOutput) InstanceType() pulumi.StringOutput { 1191 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.InstanceType }).(pulumi.StringOutput) 1192 } 1193 1194 // Number of IPv6 addresses to associate with the primary network interface. Amazon EC2 chooses the IPv6 addresses from the range of your subnet. 1195 func (o InstanceOutput) Ipv6AddressCount() pulumi.IntOutput { 1196 return o.ApplyT(func(v *Instance) pulumi.IntOutput { return v.Ipv6AddressCount }).(pulumi.IntOutput) 1197 } 1198 1199 // Specify one or more IPv6 addresses from the range of the subnet to associate with the primary network interface 1200 func (o InstanceOutput) Ipv6Addresses() pulumi.StringArrayOutput { 1201 return o.ApplyT(func(v *Instance) pulumi.StringArrayOutput { return v.Ipv6Addresses }).(pulumi.StringArrayOutput) 1202 } 1203 1204 // Key name of the Key Pair to use for the instance; which can be managed using the `ec2.KeyPair` resource. 1205 func (o InstanceOutput) KeyName() pulumi.StringOutput { 1206 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.KeyName }).(pulumi.StringOutput) 1207 } 1208 1209 // Specifies a Launch Template to configure the instance. Parameters configured on this resource will override the corresponding parameters in the Launch Template. See Launch Template Specification below for more details. 1210 func (o InstanceOutput) LaunchTemplate() InstanceLaunchTemplatePtrOutput { 1211 return o.ApplyT(func(v *Instance) InstanceLaunchTemplatePtrOutput { return v.LaunchTemplate }).(InstanceLaunchTemplatePtrOutput) 1212 } 1213 1214 // Maintenance and recovery options for the instance. See Maintenance Options below for more details. 1215 func (o InstanceOutput) MaintenanceOptions() InstanceMaintenanceOptionsOutput { 1216 return o.ApplyT(func(v *Instance) InstanceMaintenanceOptionsOutput { return v.MaintenanceOptions }).(InstanceMaintenanceOptionsOutput) 1217 } 1218 1219 // Customize the metadata options of the instance. See Metadata Options below for more details. 1220 func (o InstanceOutput) MetadataOptions() InstanceMetadataOptionsOutput { 1221 return o.ApplyT(func(v *Instance) InstanceMetadataOptionsOutput { return v.MetadataOptions }).(InstanceMetadataOptionsOutput) 1222 } 1223 1224 // If true, the launched EC2 instance will have detailed monitoring enabled. (Available since v0.6.0) 1225 func (o InstanceOutput) Monitoring() pulumi.BoolOutput { 1226 return o.ApplyT(func(v *Instance) pulumi.BoolOutput { return v.Monitoring }).(pulumi.BoolOutput) 1227 } 1228 1229 // Customize network interfaces to be attached at instance boot time. See Network Interfaces below for more details. 1230 func (o InstanceOutput) NetworkInterfaces() InstanceNetworkInterfaceArrayOutput { 1231 return o.ApplyT(func(v *Instance) InstanceNetworkInterfaceArrayOutput { return v.NetworkInterfaces }).(InstanceNetworkInterfaceArrayOutput) 1232 } 1233 1234 // ARN of the Outpost the instance is assigned to. 1235 func (o InstanceOutput) OutpostArn() pulumi.StringOutput { 1236 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.OutpostArn }).(pulumi.StringOutput) 1237 } 1238 1239 // Base-64 encoded encrypted password data for the instance. Useful for getting the administrator password for instances running Microsoft Windows. This attribute is only exported if `getPasswordData` is true. Note that this encrypted value will be stored in the state file, as with all exported attributes. See [GetPasswordData](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_GetPasswordData.html) for more information. 1240 func (o InstanceOutput) PasswordData() pulumi.StringOutput { 1241 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.PasswordData }).(pulumi.StringOutput) 1242 } 1243 1244 // Placement Group to start the instance in. 1245 func (o InstanceOutput) PlacementGroup() pulumi.StringOutput { 1246 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.PlacementGroup }).(pulumi.StringOutput) 1247 } 1248 1249 // Number of the partition the instance is in. Valid only if the `ec2.PlacementGroup` resource's `strategy` argument is set to `"partition"`. 1250 func (o InstanceOutput) PlacementPartitionNumber() pulumi.IntOutput { 1251 return o.ApplyT(func(v *Instance) pulumi.IntOutput { return v.PlacementPartitionNumber }).(pulumi.IntOutput) 1252 } 1253 1254 // ID of the instance's primary network interface. 1255 func (o InstanceOutput) PrimaryNetworkInterfaceId() pulumi.StringOutput { 1256 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.PrimaryNetworkInterfaceId }).(pulumi.StringOutput) 1257 } 1258 1259 // Private DNS name assigned to the instance. Can only be used inside the Amazon EC2, and only available if you've enabled DNS hostnames for your VPC. 1260 func (o InstanceOutput) PrivateDns() pulumi.StringOutput { 1261 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.PrivateDns }).(pulumi.StringOutput) 1262 } 1263 1264 // Options for the instance hostname. The default values are inherited from the subnet. See Private DNS Name Options below for more details. 1265 func (o InstanceOutput) PrivateDnsNameOptions() InstancePrivateDnsNameOptionsOutput { 1266 return o.ApplyT(func(v *Instance) InstancePrivateDnsNameOptionsOutput { return v.PrivateDnsNameOptions }).(InstancePrivateDnsNameOptionsOutput) 1267 } 1268 1269 // Private IP address to associate with the instance in a VPC. 1270 func (o InstanceOutput) PrivateIp() pulumi.StringOutput { 1271 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.PrivateIp }).(pulumi.StringOutput) 1272 } 1273 1274 // Public DNS name assigned to the instance. For EC2-VPC, this is only available if you've enabled DNS hostnames for your VPC. 1275 func (o InstanceOutput) PublicDns() pulumi.StringOutput { 1276 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.PublicDns }).(pulumi.StringOutput) 1277 } 1278 1279 // Public IP address assigned to the instance, if applicable. **NOTE**: If you are using an `ec2.Eip` with your instance, you should refer to the EIP's address directly and not use `publicIp` as this field will change after the EIP is attached. 1280 func (o InstanceOutput) PublicIp() pulumi.StringOutput { 1281 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.PublicIp }).(pulumi.StringOutput) 1282 } 1283 1284 // Configuration block to customize details about the root block device of the instance. See Block Devices below for details. When accessing this as an attribute reference, it is a list containing one object. 1285 func (o InstanceOutput) RootBlockDevice() InstanceRootBlockDeviceOutput { 1286 return o.ApplyT(func(v *Instance) InstanceRootBlockDeviceOutput { return v.RootBlockDevice }).(InstanceRootBlockDeviceOutput) 1287 } 1288 1289 // List of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e., referenced in a `networkInterface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type. 1290 func (o InstanceOutput) SecondaryPrivateIps() pulumi.StringArrayOutput { 1291 return o.ApplyT(func(v *Instance) pulumi.StringArrayOutput { return v.SecondaryPrivateIps }).(pulumi.StringArrayOutput) 1292 } 1293 1294 // List of security group names to associate with. 1295 // 1296 // > **NOTE:** If you are creating Instances in a VPC, use `vpcSecurityGroupIds` instead. 1297 // 1298 // Deprecated: Use of `securityGroups` is discouraged as it does not allow for changes and will force your instance to be replaced if changes are made. To avoid this, use `vpcSecurityGroupIds` which allows for updates. 1299 func (o InstanceOutput) SecurityGroups() pulumi.StringArrayOutput { 1300 return o.ApplyT(func(v *Instance) pulumi.StringArrayOutput { return v.SecurityGroups }).(pulumi.StringArrayOutput) 1301 } 1302 1303 // Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. Defaults true. 1304 func (o InstanceOutput) SourceDestCheck() pulumi.BoolPtrOutput { 1305 return o.ApplyT(func(v *Instance) pulumi.BoolPtrOutput { return v.SourceDestCheck }).(pulumi.BoolPtrOutput) 1306 } 1307 1308 // If the request is a Spot Instance request, the ID of the request. 1309 func (o InstanceOutput) SpotInstanceRequestId() pulumi.StringOutput { 1310 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.SpotInstanceRequestId }).(pulumi.StringOutput) 1311 } 1312 1313 // VPC Subnet ID to launch in. 1314 func (o InstanceOutput) SubnetId() pulumi.StringOutput { 1315 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.SubnetId }).(pulumi.StringOutput) 1316 } 1317 1318 // Map of tags to assign to the resource. Note that these tags apply to the instance and not block storage devices. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level. 1319 func (o InstanceOutput) Tags() pulumi.StringMapOutput { 1320 return o.ApplyT(func(v *Instance) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput) 1321 } 1322 1323 // Map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block. 1324 // 1325 // Deprecated: Please use `tags` instead. 1326 func (o InstanceOutput) TagsAll() pulumi.StringMapOutput { 1327 return o.ApplyT(func(v *Instance) pulumi.StringMapOutput { return v.TagsAll }).(pulumi.StringMapOutput) 1328 } 1329 1330 // Tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of `dedicated` runs on single-tenant hardware. The `host` tenancy is not supported for the import-instance command. Valid values are `default`, `dedicated`, and `host`. 1331 func (o InstanceOutput) Tenancy() pulumi.StringOutput { 1332 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.Tenancy }).(pulumi.StringOutput) 1333 } 1334 1335 // User data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `userDataBase64` instead. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. 1336 func (o InstanceOutput) UserData() pulumi.StringOutput { 1337 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.UserData }).(pulumi.StringOutput) 1338 } 1339 1340 // Can be used instead of `userData` to pass base64-encoded binary data directly. Use this instead of `userData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. Updates to this field will trigger a stop/start of the EC2 instance by default. If the `userDataReplaceOnChange` is set then updates to this field will trigger a destroy and recreate. 1341 func (o InstanceOutput) UserDataBase64() pulumi.StringOutput { 1342 return o.ApplyT(func(v *Instance) pulumi.StringOutput { return v.UserDataBase64 }).(pulumi.StringOutput) 1343 } 1344 1345 // When used in combination with `userData` or `userDataBase64` will trigger a destroy and recreate when set to `true`. Defaults to `false` if not set. 1346 func (o InstanceOutput) UserDataReplaceOnChange() pulumi.BoolPtrOutput { 1347 return o.ApplyT(func(v *Instance) pulumi.BoolPtrOutput { return v.UserDataReplaceOnChange }).(pulumi.BoolPtrOutput) 1348 } 1349 1350 // Map of tags to assign, at instance-creation time, to root and EBS volumes. 1351 // 1352 // > **NOTE:** Do not use `volumeTags` if you plan to manage block device tags outside the `ec2.Instance` configuration, such as using `tags` in an `ebs.Volume` resource attached via `ec2.VolumeAttachment`. Doing so will result in resource cycling and inconsistent behavior. 1353 func (o InstanceOutput) VolumeTags() pulumi.StringMapOutput { 1354 return o.ApplyT(func(v *Instance) pulumi.StringMapOutput { return v.VolumeTags }).(pulumi.StringMapOutput) 1355 } 1356 1357 // List of security group IDs to associate with. 1358 func (o InstanceOutput) VpcSecurityGroupIds() pulumi.StringArrayOutput { 1359 return o.ApplyT(func(v *Instance) pulumi.StringArrayOutput { return v.VpcSecurityGroupIds }).(pulumi.StringArrayOutput) 1360 } 1361 1362 type InstanceArrayOutput struct{ *pulumi.OutputState } 1363 1364 func (InstanceArrayOutput) ElementType() reflect.Type { 1365 return reflect.TypeOf((*[]*Instance)(nil)).Elem() 1366 } 1367 1368 func (o InstanceArrayOutput) ToInstanceArrayOutput() InstanceArrayOutput { 1369 return o 1370 } 1371 1372 func (o InstanceArrayOutput) ToInstanceArrayOutputWithContext(ctx context.Context) InstanceArrayOutput { 1373 return o 1374 } 1375 1376 func (o InstanceArrayOutput) Index(i pulumi.IntInput) InstanceOutput { 1377 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Instance { 1378 return vs[0].([]*Instance)[vs[1].(int)] 1379 }).(InstanceOutput) 1380 } 1381 1382 type InstanceMapOutput struct{ *pulumi.OutputState } 1383 1384 func (InstanceMapOutput) ElementType() reflect.Type { 1385 return reflect.TypeOf((*map[string]*Instance)(nil)).Elem() 1386 } 1387 1388 func (o InstanceMapOutput) ToInstanceMapOutput() InstanceMapOutput { 1389 return o 1390 } 1391 1392 func (o InstanceMapOutput) ToInstanceMapOutputWithContext(ctx context.Context) InstanceMapOutput { 1393 return o 1394 } 1395 1396 func (o InstanceMapOutput) MapIndex(k pulumi.StringInput) InstanceOutput { 1397 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Instance { 1398 return vs[0].(map[string]*Instance)[vs[1].(string)] 1399 }).(InstanceOutput) 1400 } 1401 1402 func init() { 1403 pulumi.RegisterInputType(reflect.TypeOf((*InstanceInput)(nil)).Elem(), &Instance{}) 1404 pulumi.RegisterInputType(reflect.TypeOf((*InstanceArrayInput)(nil)).Elem(), InstanceArray{}) 1405 pulumi.RegisterInputType(reflect.TypeOf((*InstanceMapInput)(nil)).Elem(), InstanceMap{}) 1406 pulumi.RegisterOutputType(InstanceOutput{}) 1407 pulumi.RegisterOutputType(InstanceArrayOutput{}) 1408 pulumi.RegisterOutputType(InstanceMapOutput{}) 1409 }