ibm.IsInstanceAction
Explore with Pulumi AI
Start, stop, or reboot an instance for VPC. For more information, about managing VPC instance, see about virtual server instances for VPC.
Note:
VPC infrastructure services are a regional specific based endpoint, by default targets to us-south
. Please make sure to target right region in the provider block as shown in the provider.tf
file, if VPC service is created in region other than us-south
.
provider.tf
import * as pulumi from "@pulumi/pulumi";
import pulumi
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
return await Deployment.RunAsync(() =>
{
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
}
}
{}
Example Usage
In the following example, you can perform instance action:
Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.IsVpc;
import com.pulumi.ibm.IsSubnet;
import com.pulumi.ibm.IsSubnetArgs;
import com.pulumi.ibm.IsSshKey;
import com.pulumi.ibm.IsSshKeyArgs;
import com.pulumi.ibm.IsInstance;
import com.pulumi.ibm.IsInstanceArgs;
import com.pulumi.ibm.inputs.IsInstanceBootVolumeArgs;
import com.pulumi.ibm.inputs.IsInstancePrimaryNetworkInterfaceArgs;
import com.pulumi.ibm.inputs.IsInstanceNetworkInterfaceArgs;
import com.pulumi.ibm.IsInstanceAction;
import com.pulumi.ibm.IsInstanceActionArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleIsVpc = new IsVpc("exampleIsVpc");
var exampleIsSubnet = new IsSubnet("exampleIsSubnet", IsSubnetArgs.builder()
.vpc(exampleIsVpc.isVpcId())
.zone("us-south-1")
.ipv4CidrBlock("10.240.0.0/24")
.build());
var exampleIsSshKey = new IsSshKey("exampleIsSshKey", IsSshKeyArgs.builder()
.publicKey("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVERRN7/9484SOBJ3HSKxxNG5JN8owAjy5f9yYwcUg+JaUVuytn5Pv3aeYROHGGg+5G346xaq3DAwX6Y5ykr2fvjObgncQBnuU5KHWCECO/4h8uWuwh/kfniXPVjFToc+gnkqA+3RKpAecZhFXwfalQ9mMuYGFxn+fwn8cYEApsJbsEmb0iJwPiZ5hjFC8wREuiTlhPHDgkBLOiycd20op2nXzDbHfCHInquEe/gYxEitALONxm0swBOwJZwlTDOB7C6y2dzlrtxr1L59m7pCkWI4EtTRLvleehBoj3u7jB4usR")
.build());
var exampleIsInstance = new IsInstance("exampleIsInstance", IsInstanceArgs.builder()
.image("7eb4e35b-4257-56f8-d7da-326d85452591")
.profile("bx2-2x8")
.bootVolume(IsInstanceBootVolumeArgs.builder()
.encryption("crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179")
.build())
.primaryNetworkInterface(IsInstancePrimaryNetworkInterfaceArgs.builder()
.subnet(exampleIsSubnet.isSubnetId())
.primaryIpv4Address("10.240.0.6")
.allowIpSpoofing(true)
.build())
.networkInterfaces(IsInstanceNetworkInterfaceArgs.builder()
.name("eth1")
.subnet(exampleIsSubnet.isSubnetId())
.allowIpSpoofing(false)
.build())
.vpc(exampleIsVpc.isVpcId())
.zone("us-south-1")
.keys(exampleIsSshKey.isSshKeyId())
.timeouts(IsInstanceTimeoutsArgs.builder()
.create("15m")
.update("15m")
.delete("15m")
.build())
.build());
var exampleIsInstanceAction = new IsInstanceAction("exampleIsInstanceAction", IsInstanceActionArgs.builder()
.action("stop")
.forceAction(true)
.instance(exampleIsInstance.isInstanceId())
.build());
}
}
resources:
exampleIsVpc:
type: ibm:IsVpc
exampleIsSubnet:
type: ibm:IsSubnet
properties:
vpc: ${exampleIsVpc.isVpcId}
zone: us-south-1
ipv4CidrBlock: 10.240.0.0/24
exampleIsSshKey:
type: ibm:IsSshKey
properties:
publicKey: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCKVmnMOlHKcZK8tpt3MP1lqOLAcqcJzhsvJcjscgVERRN7/9484SOBJ3HSKxxNG5JN8owAjy5f9yYwcUg+JaUVuytn5Pv3aeYROHGGg+5G346xaq3DAwX6Y5ykr2fvjObgncQBnuU5KHWCECO/4h8uWuwh/kfniXPVjFToc+gnkqA+3RKpAecZhFXwfalQ9mMuYGFxn+fwn8cYEApsJbsEmb0iJwPiZ5hjFC8wREuiTlhPHDgkBLOiycd20op2nXzDbHfCHInquEe/gYxEitALONxm0swBOwJZwlTDOB7C6y2dzlrtxr1L59m7pCkWI4EtTRLvleehBoj3u7jB4usR
exampleIsInstance:
type: ibm:IsInstance
properties:
image: 7eb4e35b-4257-56f8-d7da-326d85452591
profile: bx2-2x8
bootVolume:
encryption: crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179
primaryNetworkInterface:
subnet: ${exampleIsSubnet.isSubnetId}
primaryIpv4Address: 10.240.0.6
allowIpSpoofing: true
networkInterfaces:
- name: eth1
subnet: ${exampleIsSubnet.isSubnetId}
allowIpSpoofing: false
vpc: ${exampleIsVpc.isVpcId}
zone: us-south-1
keys:
- ${exampleIsSshKey.isSshKeyId}
# User can configure timeouts
timeouts:
- create: 15m
update: 15m
delete: 15m
exampleIsInstanceAction:
type: ibm:IsInstanceAction
properties:
action: stop
forceAction: true
instance: ${exampleIsInstance.isInstanceId}
Create IsInstanceAction Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IsInstanceAction(name: string, args: IsInstanceActionArgs, opts?: CustomResourceOptions);
@overload
def IsInstanceAction(resource_name: str,
args: IsInstanceActionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def IsInstanceAction(resource_name: str,
opts: Optional[ResourceOptions] = None,
action: Optional[str] = None,
instance: Optional[str] = None,
force_action: Optional[bool] = None,
is_instance_action_id: Optional[str] = None,
timeouts: Optional[IsInstanceActionTimeoutsArgs] = None)
func NewIsInstanceAction(ctx *Context, name string, args IsInstanceActionArgs, opts ...ResourceOption) (*IsInstanceAction, error)
public IsInstanceAction(string name, IsInstanceActionArgs args, CustomResourceOptions? opts = null)
public IsInstanceAction(String name, IsInstanceActionArgs args)
public IsInstanceAction(String name, IsInstanceActionArgs args, CustomResourceOptions options)
type: ibm:IsInstanceAction
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args IsInstanceActionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args IsInstanceActionArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args IsInstanceActionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IsInstanceActionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IsInstanceActionArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var isInstanceActionResource = new Ibm.IsInstanceAction("isInstanceActionResource", new()
{
Action = "string",
Instance = "string",
ForceAction = false,
IsInstanceActionId = "string",
Timeouts = new Ibm.Inputs.IsInstanceActionTimeoutsArgs
{
Create = "string",
Delete = "string",
},
});
example, err := ibm.NewIsInstanceAction(ctx, "isInstanceActionResource", &ibm.IsInstanceActionArgs{
Action: pulumi.String("string"),
Instance: pulumi.String("string"),
ForceAction: pulumi.Bool(false),
IsInstanceActionId: pulumi.String("string"),
Timeouts: &ibm.IsInstanceActionTimeoutsArgs{
Create: pulumi.String("string"),
Delete: pulumi.String("string"),
},
})
var isInstanceActionResource = new IsInstanceAction("isInstanceActionResource", IsInstanceActionArgs.builder()
.action("string")
.instance("string")
.forceAction(false)
.isInstanceActionId("string")
.timeouts(IsInstanceActionTimeoutsArgs.builder()
.create("string")
.delete("string")
.build())
.build());
is_instance_action_resource = ibm.IsInstanceAction("isInstanceActionResource",
action="string",
instance="string",
force_action=False,
is_instance_action_id="string",
timeouts={
"create": "string",
"delete": "string",
})
const isInstanceActionResource = new ibm.IsInstanceAction("isInstanceActionResource", {
action: "string",
instance: "string",
forceAction: false,
isInstanceActionId: "string",
timeouts: {
create: "string",
"delete": "string",
},
});
type: ibm:IsInstanceAction
properties:
action: string
forceAction: false
instance: string
isInstanceActionId: string
timeouts:
create: string
delete: string
IsInstanceAction Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The IsInstanceAction resource accepts the following input properties:
- Action string
- The type of action to perfrom on the instance. Supported values are
stop
,start
, orreboot
. - Instance string
- Instance identifier.
- Force
Action bool - If set to
true
, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. The Default value isfalse
. - Is
Instance stringAction Id - Timeouts
Is
Instance Action Timeouts
- Action string
- The type of action to perfrom on the instance. Supported values are
stop
,start
, orreboot
. - Instance string
- Instance identifier.
- Force
Action bool - If set to
true
, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. The Default value isfalse
. - Is
Instance stringAction Id - Timeouts
Is
Instance Action Timeouts Args
- action String
- The type of action to perfrom on the instance. Supported values are
stop
,start
, orreboot
. - instance String
- Instance identifier.
- force
Action Boolean - If set to
true
, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. The Default value isfalse
. - is
Instance StringAction Id - timeouts
Is
Instance Action Timeouts
- action string
- The type of action to perfrom on the instance. Supported values are
stop
,start
, orreboot
. - instance string
- Instance identifier.
- force
Action boolean - If set to
true
, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. The Default value isfalse
. - is
Instance stringAction Id - timeouts
Is
Instance Action Timeouts
- action str
- The type of action to perfrom on the instance. Supported values are
stop
,start
, orreboot
. - instance str
- Instance identifier.
- force_
action bool - If set to
true
, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. The Default value isfalse
. - is_
instance_ straction_ id - timeouts
Is
Instance Action Timeouts Args
- action String
- The type of action to perfrom on the instance. Supported values are
stop
,start
, orreboot
. - instance String
- Instance identifier.
- force
Action Boolean - If set to
true
, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. The Default value isfalse
. - is
Instance StringAction Id - timeouts Property Map
Outputs
All input properties are implicitly available as output properties. Additionally, the IsInstanceAction resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- (String) The status of the instance.
- Status
Reasons List<IsInstance Action Status Reason> - (List) Array of reasons for the current status (if any).
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- (String) The status of the instance.
- Status
Reasons []IsInstance Action Status Reason - (List) Array of reasons for the current status (if any).
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- (String) The status of the instance.
- status
Reasons List<IsInstance Action Status Reason> - (List) Array of reasons for the current status (if any).
- id string
- The provider-assigned unique ID for this managed resource.
- status string
- (String) The status of the instance.
- status
Reasons IsInstance Action Status Reason[] - (List) Array of reasons for the current status (if any).
- id str
- The provider-assigned unique ID for this managed resource.
- status str
- (String) The status of the instance.
- status_
reasons Sequence[IsInstance Action Status Reason] - (List) Array of reasons for the current status (if any).
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- (String) The status of the instance.
- status
Reasons List<Property Map> - (List) Array of reasons for the current status (if any).
Look up Existing IsInstanceAction Resource
Get an existing IsInstanceAction resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: IsInstanceActionState, opts?: CustomResourceOptions): IsInstanceAction
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
action: Optional[str] = None,
force_action: Optional[bool] = None,
instance: Optional[str] = None,
is_instance_action_id: Optional[str] = None,
status: Optional[str] = None,
status_reasons: Optional[Sequence[IsInstanceActionStatusReasonArgs]] = None,
timeouts: Optional[IsInstanceActionTimeoutsArgs] = None) -> IsInstanceAction
func GetIsInstanceAction(ctx *Context, name string, id IDInput, state *IsInstanceActionState, opts ...ResourceOption) (*IsInstanceAction, error)
public static IsInstanceAction Get(string name, Input<string> id, IsInstanceActionState? state, CustomResourceOptions? opts = null)
public static IsInstanceAction get(String name, Output<String> id, IsInstanceActionState state, CustomResourceOptions options)
resources: _: type: ibm:IsInstanceAction get: id: ${id}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Action string
- The type of action to perfrom on the instance. Supported values are
stop
,start
, orreboot
. - Force
Action bool - If set to
true
, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. The Default value isfalse
. - Instance string
- Instance identifier.
- Is
Instance stringAction Id - Status string
- (String) The status of the instance.
- Status
Reasons List<IsInstance Action Status Reason> - (List) Array of reasons for the current status (if any).
- Timeouts
Is
Instance Action Timeouts
- Action string
- The type of action to perfrom on the instance. Supported values are
stop
,start
, orreboot
. - Force
Action bool - If set to
true
, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. The Default value isfalse
. - Instance string
- Instance identifier.
- Is
Instance stringAction Id - Status string
- (String) The status of the instance.
- Status
Reasons []IsInstance Action Status Reason Args - (List) Array of reasons for the current status (if any).
- Timeouts
Is
Instance Action Timeouts Args
- action String
- The type of action to perfrom on the instance. Supported values are
stop
,start
, orreboot
. - force
Action Boolean - If set to
true
, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. The Default value isfalse
. - instance String
- Instance identifier.
- is
Instance StringAction Id - status String
- (String) The status of the instance.
- status
Reasons List<IsInstance Action Status Reason> - (List) Array of reasons for the current status (if any).
- timeouts
Is
Instance Action Timeouts
- action string
- The type of action to perfrom on the instance. Supported values are
stop
,start
, orreboot
. - force
Action boolean - If set to
true
, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. The Default value isfalse
. - instance string
- Instance identifier.
- is
Instance stringAction Id - status string
- (String) The status of the instance.
- status
Reasons IsInstance Action Status Reason[] - (List) Array of reasons for the current status (if any).
- timeouts
Is
Instance Action Timeouts
- action str
- The type of action to perfrom on the instance. Supported values are
stop
,start
, orreboot
. - force_
action bool - If set to
true
, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. The Default value isfalse
. - instance str
- Instance identifier.
- is_
instance_ straction_ id - status str
- (String) The status of the instance.
- status_
reasons Sequence[IsInstance Action Status Reason Args] - (List) Array of reasons for the current status (if any).
- timeouts
Is
Instance Action Timeouts Args
- action String
- The type of action to perfrom on the instance. Supported values are
stop
,start
, orreboot
. - force
Action Boolean - If set to
true
, the action will be forced immediately, and all queued actions deleted. Ignored for the start action. The Default value isfalse
. - instance String
- Instance identifier.
- is
Instance StringAction Id - status String
- (String) The status of the instance.
- status
Reasons List<Property Map> - (List) Array of reasons for the current status (if any).
- timeouts Property Map
Supporting Types
IsInstanceActionStatusReason, IsInstanceActionStatusReasonArgs
IsInstanceActionTimeouts, IsInstanceActionTimeoutsArgs
Import
The ibm_is_instance_action
resource can be imported by using instance action ID.
Example
$ pulumi import ibm:index/isInstanceAction:IsInstanceAction example d7bec597-4726-451f-8a63-e62e6f121c32c
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.