1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. expressconnect
  5. EcFailoverTestJob
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

alicloud.expressconnect.EcFailoverTestJob

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

    Provides a Express Connect Ec Failover Test Job resource. Express Connect Failover Test Job.

    For information about Express Connect Ec Failover Test Job and how to use it, see What is Ec Failover Test Job.

    NOTE: Available since v1.215.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform-example";
    const default = alicloud.expressconnect.getPhysicalConnections({
        nameRegex: "preserved-NODELETING",
    });
    const defaultEcFailoverTestJob = new alicloud.expressconnect.EcFailoverTestJob("default", {
        description: name,
        jobType: "StartNow",
        resourceIds: [
            _default.then(_default => _default.ids?.[0]),
            _default.then(_default => _default.ids?.[1]),
            _default.then(_default => _default.ids?.[2]),
        ],
        jobDuration: 1,
        resourceType: "PHYSICALCONNECTION",
        ecFailoverTestJobName: name,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform-example"
    default = alicloud.expressconnect.get_physical_connections(name_regex="preserved-NODELETING")
    default_ec_failover_test_job = alicloud.expressconnect.EcFailoverTestJob("default",
        description=name,
        job_type="StartNow",
        resource_ids=[
            default.ids[0],
            default.ids[1],
            default.ids[2],
        ],
        job_duration=1,
        resource_type="PHYSICALCONNECTION",
        ec_failover_test_job_name=name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/expressconnect"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform-example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_default, err := expressconnect.GetPhysicalConnections(ctx, &expressconnect.GetPhysicalConnectionsArgs{
    			NameRegex: pulumi.StringRef("preserved-NODELETING"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = expressconnect.NewEcFailoverTestJob(ctx, "default", &expressconnect.EcFailoverTestJobArgs{
    			Description: pulumi.String(name),
    			JobType:     pulumi.String("StartNow"),
    			ResourceIds: pulumi.StringArray{
    				pulumi.String(_default.Ids[0]),
    				pulumi.String(_default.Ids[1]),
    				pulumi.String(_default.Ids[2]),
    			},
    			JobDuration:           pulumi.Int(1),
    			ResourceType:          pulumi.String("PHYSICALCONNECTION"),
    			EcFailoverTestJobName: pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform-example";
        var @default = AliCloud.ExpressConnect.GetPhysicalConnections.Invoke(new()
        {
            NameRegex = "preserved-NODELETING",
        });
    
        var defaultEcFailoverTestJob = new AliCloud.ExpressConnect.EcFailoverTestJob("default", new()
        {
            Description = name,
            JobType = "StartNow",
            ResourceIds = new[]
            {
                @default.Apply(@default => @default.Apply(getPhysicalConnectionsResult => getPhysicalConnectionsResult.Ids[0])),
                @default.Apply(@default => @default.Apply(getPhysicalConnectionsResult => getPhysicalConnectionsResult.Ids[1])),
                @default.Apply(@default => @default.Apply(getPhysicalConnectionsResult => getPhysicalConnectionsResult.Ids[2])),
            },
            JobDuration = 1,
            ResourceType = "PHYSICALCONNECTION",
            EcFailoverTestJobName = name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.expressconnect.ExpressconnectFunctions;
    import com.pulumi.alicloud.expressconnect.inputs.GetPhysicalConnectionsArgs;
    import com.pulumi.alicloud.expressconnect.EcFailoverTestJob;
    import com.pulumi.alicloud.expressconnect.EcFailoverTestJobArgs;
    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) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform-example");
            final var default = ExpressconnectFunctions.getPhysicalConnections(GetPhysicalConnectionsArgs.builder()
                .nameRegex("preserved-NODELETING")
                .build());
    
            var defaultEcFailoverTestJob = new EcFailoverTestJob("defaultEcFailoverTestJob", EcFailoverTestJobArgs.builder()        
                .description(name)
                .jobType("StartNow")
                .resourceIds(            
                    default_.ids()[0],
                    default_.ids()[1],
                    default_.ids()[2])
                .jobDuration("1")
                .resourceType("PHYSICALCONNECTION")
                .ecFailoverTestJobName(name)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform-example
    resources:
      defaultEcFailoverTestJob:
        type: alicloud:expressconnect:EcFailoverTestJob
        name: default
        properties:
          description: ${name}
          jobType: StartNow
          resourceIds:
            - ${default.ids[0]}
            - ${default.ids[1]}
            - ${default.ids[2]}
          jobDuration: '1'
          resourceType: PHYSICALCONNECTION
          ecFailoverTestJobName: ${name}
    variables:
      default:
        fn::invoke:
          Function: alicloud:expressconnect:getPhysicalConnections
          Arguments:
            nameRegex: preserved-NODELETING
    

    Create EcFailoverTestJob Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new EcFailoverTestJob(name: string, args: EcFailoverTestJobArgs, opts?: CustomResourceOptions);
    @overload
    def EcFailoverTestJob(resource_name: str,
                          args: EcFailoverTestJobArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def EcFailoverTestJob(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          job_duration: Optional[int] = None,
                          job_type: Optional[str] = None,
                          resource_ids: Optional[Sequence[str]] = None,
                          resource_type: Optional[str] = None,
                          description: Optional[str] = None,
                          ec_failover_test_job_name: Optional[str] = None,
                          status: Optional[str] = None)
    func NewEcFailoverTestJob(ctx *Context, name string, args EcFailoverTestJobArgs, opts ...ResourceOption) (*EcFailoverTestJob, error)
    public EcFailoverTestJob(string name, EcFailoverTestJobArgs args, CustomResourceOptions? opts = null)
    public EcFailoverTestJob(String name, EcFailoverTestJobArgs args)
    public EcFailoverTestJob(String name, EcFailoverTestJobArgs args, CustomResourceOptions options)
    
    type: alicloud:expressconnect:EcFailoverTestJob
    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 EcFailoverTestJobArgs
    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 EcFailoverTestJobArgs
    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 EcFailoverTestJobArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args EcFailoverTestJobArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args EcFailoverTestJobArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var ecFailoverTestJobResource = new AliCloud.ExpressConnect.EcFailoverTestJob("ecFailoverTestJobResource", new()
    {
        JobDuration = 0,
        JobType = "string",
        ResourceIds = new[]
        {
            "string",
        },
        ResourceType = "string",
        Description = "string",
        EcFailoverTestJobName = "string",
        Status = "string",
    });
    
    example, err := expressconnect.NewEcFailoverTestJob(ctx, "ecFailoverTestJobResource", &expressconnect.EcFailoverTestJobArgs{
    	JobDuration: pulumi.Int(0),
    	JobType:     pulumi.String("string"),
    	ResourceIds: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ResourceType:          pulumi.String("string"),
    	Description:           pulumi.String("string"),
    	EcFailoverTestJobName: pulumi.String("string"),
    	Status:                pulumi.String("string"),
    })
    
    var ecFailoverTestJobResource = new EcFailoverTestJob("ecFailoverTestJobResource", EcFailoverTestJobArgs.builder()        
        .jobDuration(0)
        .jobType("string")
        .resourceIds("string")
        .resourceType("string")
        .description("string")
        .ecFailoverTestJobName("string")
        .status("string")
        .build());
    
    ec_failover_test_job_resource = alicloud.expressconnect.EcFailoverTestJob("ecFailoverTestJobResource",
        job_duration=0,
        job_type="string",
        resource_ids=["string"],
        resource_type="string",
        description="string",
        ec_failover_test_job_name="string",
        status="string")
    
    const ecFailoverTestJobResource = new alicloud.expressconnect.EcFailoverTestJob("ecFailoverTestJobResource", {
        jobDuration: 0,
        jobType: "string",
        resourceIds: ["string"],
        resourceType: "string",
        description: "string",
        ecFailoverTestJobName: "string",
        status: "string",
    });
    
    type: alicloud:expressconnect:EcFailoverTestJob
    properties:
        description: string
        ecFailoverTestJobName: string
        jobDuration: 0
        jobType: string
        resourceIds:
            - string
        resourceType: string
        status: string
    

    EcFailoverTestJob Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The EcFailoverTestJob resource accepts the following input properties:

    JobDuration int
    Job duration.
    JobType string
    Job type.
    ResourceIds List<string>
    Resource id list.
    ResourceType string
    Resource type.
    Description string
    Job description.
    EcFailoverTestJobName string
    Job name.
    Status string
    The status of the resource.
    JobDuration int
    Job duration.
    JobType string
    Job type.
    ResourceIds []string
    Resource id list.
    ResourceType string
    Resource type.
    Description string
    Job description.
    EcFailoverTestJobName string
    Job name.
    Status string
    The status of the resource.
    jobDuration Integer
    Job duration.
    jobType String
    Job type.
    resourceIds List<String>
    Resource id list.
    resourceType String
    Resource type.
    description String
    Job description.
    ecFailoverTestJobName String
    Job name.
    status String
    The status of the resource.
    jobDuration number
    Job duration.
    jobType string
    Job type.
    resourceIds string[]
    Resource id list.
    resourceType string
    Resource type.
    description string
    Job description.
    ecFailoverTestJobName string
    Job name.
    status string
    The status of the resource.
    job_duration int
    Job duration.
    job_type str
    Job type.
    resource_ids Sequence[str]
    Resource id list.
    resource_type str
    Resource type.
    description str
    Job description.
    ec_failover_test_job_name str
    Job name.
    status str
    The status of the resource.
    jobDuration Number
    Job duration.
    jobType String
    Job type.
    resourceIds List<String>
    Resource id list.
    resourceType String
    Resource type.
    description String
    Job description.
    ecFailoverTestJobName String
    Job name.
    status String
    The status of the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the EcFailoverTestJob resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing EcFailoverTestJob Resource

    Get an existing EcFailoverTestJob 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?: EcFailoverTestJobState, opts?: CustomResourceOptions): EcFailoverTestJob
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            ec_failover_test_job_name: Optional[str] = None,
            job_duration: Optional[int] = None,
            job_type: Optional[str] = None,
            resource_ids: Optional[Sequence[str]] = None,
            resource_type: Optional[str] = None,
            status: Optional[str] = None) -> EcFailoverTestJob
    func GetEcFailoverTestJob(ctx *Context, name string, id IDInput, state *EcFailoverTestJobState, opts ...ResourceOption) (*EcFailoverTestJob, error)
    public static EcFailoverTestJob Get(string name, Input<string> id, EcFailoverTestJobState? state, CustomResourceOptions? opts = null)
    public static EcFailoverTestJob get(String name, Output<String> id, EcFailoverTestJobState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    Description string
    Job description.
    EcFailoverTestJobName string
    Job name.
    JobDuration int
    Job duration.
    JobType string
    Job type.
    ResourceIds List<string>
    Resource id list.
    ResourceType string
    Resource type.
    Status string
    The status of the resource.
    Description string
    Job description.
    EcFailoverTestJobName string
    Job name.
    JobDuration int
    Job duration.
    JobType string
    Job type.
    ResourceIds []string
    Resource id list.
    ResourceType string
    Resource type.
    Status string
    The status of the resource.
    description String
    Job description.
    ecFailoverTestJobName String
    Job name.
    jobDuration Integer
    Job duration.
    jobType String
    Job type.
    resourceIds List<String>
    Resource id list.
    resourceType String
    Resource type.
    status String
    The status of the resource.
    description string
    Job description.
    ecFailoverTestJobName string
    Job name.
    jobDuration number
    Job duration.
    jobType string
    Job type.
    resourceIds string[]
    Resource id list.
    resourceType string
    Resource type.
    status string
    The status of the resource.
    description str
    Job description.
    ec_failover_test_job_name str
    Job name.
    job_duration int
    Job duration.
    job_type str
    Job type.
    resource_ids Sequence[str]
    Resource id list.
    resource_type str
    Resource type.
    status str
    The status of the resource.
    description String
    Job description.
    ecFailoverTestJobName String
    Job name.
    jobDuration Number
    Job duration.
    jobType String
    Job type.
    resourceIds List<String>
    Resource id list.
    resourceType String
    Resource type.
    status String
    The status of the resource.

    Import

    Express Connect Ec Failover Test Job can be imported using the id, e.g.

    $ pulumi import alicloud:expressconnect/ecFailoverTestJob:EcFailoverTestJob example <id>
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi