1. Packages
  2. Alicloud Provider
  3. API Docs
  4. ecs
  5. getActivations
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

alicloud.ecs.getActivations

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.63.0 published on Monday, Sep 30, 2024 by Pulumi

    This data source provides the Ecs Activations of the current Alibaba Cloud user.

    NOTE: Available in v1.177.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const ids = alicloud.ecs.getActivations({});
    export const ecsActivationId1 = ids.then(ids => ids.activations?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    ids = alicloud.ecs.get_activations()
    pulumi.export("ecsActivationId1", ids.activations[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ecs"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		ids, err := ecs.GetActivations(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("ecsActivationId1", ids.Activations[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var ids = AliCloud.Ecs.GetActivations.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["ecsActivationId1"] = ids.Apply(getActivationsResult => getActivationsResult.Activations[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ecs.EcsFunctions;
    import com.pulumi.alicloud.ecs.inputs.GetActivationsArgs;
    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 ids = EcsFunctions.getActivations();
    
            ctx.export("ecsActivationId1", ids.applyValue(getActivationsResult -> getActivationsResult.activations()[0].id()));
        }
    }
    
    variables:
      ids:
        fn::invoke:
          Function: alicloud:ecs:getActivations
          Arguments: {}
    outputs:
      ecsActivationId1: ${ids.activations[0].id}
    

    Using getActivations

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getActivations(args: GetActivationsArgs, opts?: InvokeOptions): Promise<GetActivationsResult>
    function getActivationsOutput(args: GetActivationsOutputArgs, opts?: InvokeOptions): Output<GetActivationsResult>
    def get_activations(ids: Optional[Sequence[str]] = None,
                        instance_name: Optional[str] = None,
                        output_file: Optional[str] = None,
                        page_number: Optional[int] = None,
                        page_size: Optional[int] = None,
                        opts: Optional[InvokeOptions] = None) -> GetActivationsResult
    def get_activations_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                        instance_name: Optional[pulumi.Input[str]] = None,
                        output_file: Optional[pulumi.Input[str]] = None,
                        page_number: Optional[pulumi.Input[int]] = None,
                        page_size: Optional[pulumi.Input[int]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetActivationsResult]
    func GetActivations(ctx *Context, args *GetActivationsArgs, opts ...InvokeOption) (*GetActivationsResult, error)
    func GetActivationsOutput(ctx *Context, args *GetActivationsOutputArgs, opts ...InvokeOption) GetActivationsResultOutput

    > Note: This function is named GetActivations in the Go SDK.

    public static class GetActivations 
    {
        public static Task<GetActivationsResult> InvokeAsync(GetActivationsArgs args, InvokeOptions? opts = null)
        public static Output<GetActivationsResult> Invoke(GetActivationsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetActivationsResult> getActivations(GetActivationsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:ecs/getActivations:getActivations
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Activation IDs.
    InstanceName string
    The default prefix of the instance name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    Ids []string
    A list of Activation IDs.
    InstanceName string
    The default prefix of the instance name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PageNumber int
    PageSize int
    ids List<String>
    A list of Activation IDs.
    instanceName String
    The default prefix of the instance name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Integer
    pageSize Integer
    ids string[]
    A list of Activation IDs.
    instanceName string
    The default prefix of the instance name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    pageNumber number
    pageSize number
    ids Sequence[str]
    A list of Activation IDs.
    instance_name str
    The default prefix of the instance name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    page_number int
    page_size int
    ids List<String>
    A list of Activation IDs.
    instanceName String
    The default prefix of the instance name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    pageNumber Number
    pageSize Number

    getActivations Result

    The following output properties are available:

    Activations List<Pulumi.AliCloud.Ecs.Outputs.GetActivationsActivation>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    TotalCount int
    InstanceName string
    OutputFile string
    PageNumber int
    PageSize int
    Activations []GetActivationsActivation
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    TotalCount int
    InstanceName string
    OutputFile string
    PageNumber int
    PageSize int
    activations List<GetActivationsActivation>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    totalCount Integer
    instanceName String
    outputFile String
    pageNumber Integer
    pageSize Integer
    activations GetActivationsActivation[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    totalCount number
    instanceName string
    outputFile string
    pageNumber number
    pageSize number
    activations Sequence[GetActivationsActivation]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    total_count int
    instance_name str
    output_file str
    page_number int
    page_size int
    activations List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    totalCount Number
    instanceName String
    outputFile String
    pageNumber Number
    pageSize Number

    Supporting Types

    GetActivationsActivation

    ActivationId string
    The ID of the activation code.
    CreateTime string
    The time when the activation code was created.
    DeregisteredCount int
    The number of instances that have been logged out.
    Description string
    Description of the corresponding activation code.
    Disabled bool
    Indicates whether the activation code is disabled.
    Id string
    The ID of the Activation.
    InstanceCount int
    The maximum number of times the activation code is used to register a managed instance.
    InstanceName string
    The default prefix of the instance name.
    IpAddressRange string
    The IP address of the host that allows the activation code to be used.
    RegisteredCount int
    The number of instances that were registered.
    TimeToLiveInHours int
    The validity period of the activation code. Unit: hours.
    ActivationId string
    The ID of the activation code.
    CreateTime string
    The time when the activation code was created.
    DeregisteredCount int
    The number of instances that have been logged out.
    Description string
    Description of the corresponding activation code.
    Disabled bool
    Indicates whether the activation code is disabled.
    Id string
    The ID of the Activation.
    InstanceCount int
    The maximum number of times the activation code is used to register a managed instance.
    InstanceName string
    The default prefix of the instance name.
    IpAddressRange string
    The IP address of the host that allows the activation code to be used.
    RegisteredCount int
    The number of instances that were registered.
    TimeToLiveInHours int
    The validity period of the activation code. Unit: hours.
    activationId String
    The ID of the activation code.
    createTime String
    The time when the activation code was created.
    deregisteredCount Integer
    The number of instances that have been logged out.
    description String
    Description of the corresponding activation code.
    disabled Boolean
    Indicates whether the activation code is disabled.
    id String
    The ID of the Activation.
    instanceCount Integer
    The maximum number of times the activation code is used to register a managed instance.
    instanceName String
    The default prefix of the instance name.
    ipAddressRange String
    The IP address of the host that allows the activation code to be used.
    registeredCount Integer
    The number of instances that were registered.
    timeToLiveInHours Integer
    The validity period of the activation code. Unit: hours.
    activationId string
    The ID of the activation code.
    createTime string
    The time when the activation code was created.
    deregisteredCount number
    The number of instances that have been logged out.
    description string
    Description of the corresponding activation code.
    disabled boolean
    Indicates whether the activation code is disabled.
    id string
    The ID of the Activation.
    instanceCount number
    The maximum number of times the activation code is used to register a managed instance.
    instanceName string
    The default prefix of the instance name.
    ipAddressRange string
    The IP address of the host that allows the activation code to be used.
    registeredCount number
    The number of instances that were registered.
    timeToLiveInHours number
    The validity period of the activation code. Unit: hours.
    activation_id str
    The ID of the activation code.
    create_time str
    The time when the activation code was created.
    deregistered_count int
    The number of instances that have been logged out.
    description str
    Description of the corresponding activation code.
    disabled bool
    Indicates whether the activation code is disabled.
    id str
    The ID of the Activation.
    instance_count int
    The maximum number of times the activation code is used to register a managed instance.
    instance_name str
    The default prefix of the instance name.
    ip_address_range str
    The IP address of the host that allows the activation code to be used.
    registered_count int
    The number of instances that were registered.
    time_to_live_in_hours int
    The validity period of the activation code. Unit: hours.
    activationId String
    The ID of the activation code.
    createTime String
    The time when the activation code was created.
    deregisteredCount Number
    The number of instances that have been logged out.
    description String
    Description of the corresponding activation code.
    disabled Boolean
    Indicates whether the activation code is disabled.
    id String
    The ID of the Activation.
    instanceCount Number
    The maximum number of times the activation code is used to register a managed instance.
    instanceName String
    The default prefix of the instance name.
    ipAddressRange String
    The IP address of the host that allows the activation code to be used.
    registeredCount Number
    The number of instances that were registered.
    timeToLiveInHours Number
    The validity period of the activation code. Unit: hours.

    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.63.0 published on Monday, Sep 30, 2024 by Pulumi