1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. ecs
  5. getActivations
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.ecs.getActivations

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 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);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.ecs.get_activations()
pulumi.export("ecsActivationId1", ids.activations[0].id)
Copy
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, &ecs.GetActivationsArgs{}, nil)
		if err != nil {
			return err
		}
		ctx.Export("ecsActivationId1", ids.Activations[0].Id)
		return nil
	})
}
Copy
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),
    };
});
Copy
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()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:ecs:getActivations
      arguments: {}
outputs:
  ecsActivationId1: ${ids.activations[0].id}
Copy

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>
Copy
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]
Copy
func GetActivations(ctx *Context, args *GetActivationsArgs, opts ...InvokeOption) (*GetActivationsResult, error)
func GetActivationsOutput(ctx *Context, args *GetActivationsOutputArgs, opts ...InvokeOption) GetActivationsResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetActivationsResult> getActivations(GetActivationsArgs args, InvokeOptions options)
public static Output<GetActivationsResult> getActivations(GetActivationsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:ecs/getActivations:getActivations
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Ids Changes to this property will trigger replacement. List<string>
A list of Activation IDs.
InstanceName Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. []string
A list of Activation IDs.
InstanceName Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<String>
A list of Activation IDs.
instanceName Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. string[]
A list of Activation IDs.
instanceName Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. Sequence[str]
A list of Activation IDs.
instance_name Changes to this property will trigger replacement. 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 Changes to this property will trigger replacement. List<String>
A list of Activation IDs.
instanceName Changes to this property will trigger replacement. 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 This property is required. string
The ID of the activation code.
CreateTime This property is required. string
The time when the activation code was created.
DeregisteredCount This property is required. int
The number of instances that have been logged out.
Description This property is required. string
Description of the corresponding activation code.
Disabled This property is required. bool
Indicates whether the activation code is disabled.
Id This property is required. string
The ID of the Activation.
InstanceCount This property is required. int
The maximum number of times the activation code is used to register a managed instance.
InstanceName This property is required. string
The default prefix of the instance name.
IpAddressRange This property is required. string
The IP address of the host that allows the activation code to be used.
RegisteredCount This property is required. int
The number of instances that were registered.
TimeToLiveInHours This property is required. int
The validity period of the activation code. Unit: hours.
ActivationId This property is required. string
The ID of the activation code.
CreateTime This property is required. string
The time when the activation code was created.
DeregisteredCount This property is required. int
The number of instances that have been logged out.
Description This property is required. string
Description of the corresponding activation code.
Disabled This property is required. bool
Indicates whether the activation code is disabled.
Id This property is required. string
The ID of the Activation.
InstanceCount This property is required. int
The maximum number of times the activation code is used to register a managed instance.
InstanceName This property is required. string
The default prefix of the instance name.
IpAddressRange This property is required. string
The IP address of the host that allows the activation code to be used.
RegisteredCount This property is required. int
The number of instances that were registered.
TimeToLiveInHours This property is required. int
The validity period of the activation code. Unit: hours.
activationId This property is required. String
The ID of the activation code.
createTime This property is required. String
The time when the activation code was created.
deregisteredCount This property is required. Integer
The number of instances that have been logged out.
description This property is required. String
Description of the corresponding activation code.
disabled This property is required. Boolean
Indicates whether the activation code is disabled.
id This property is required. String
The ID of the Activation.
instanceCount This property is required. Integer
The maximum number of times the activation code is used to register a managed instance.
instanceName This property is required. String
The default prefix of the instance name.
ipAddressRange This property is required. String
The IP address of the host that allows the activation code to be used.
registeredCount This property is required. Integer
The number of instances that were registered.
timeToLiveInHours This property is required. Integer
The validity period of the activation code. Unit: hours.
activationId This property is required. string
The ID of the activation code.
createTime This property is required. string
The time when the activation code was created.
deregisteredCount This property is required. number
The number of instances that have been logged out.
description This property is required. string
Description of the corresponding activation code.
disabled This property is required. boolean
Indicates whether the activation code is disabled.
id This property is required. string
The ID of the Activation.
instanceCount This property is required. number
The maximum number of times the activation code is used to register a managed instance.
instanceName This property is required. string
The default prefix of the instance name.
ipAddressRange This property is required. string
The IP address of the host that allows the activation code to be used.
registeredCount This property is required. number
The number of instances that were registered.
timeToLiveInHours This property is required. number
The validity period of the activation code. Unit: hours.
activation_id This property is required. str
The ID of the activation code.
create_time This property is required. str
The time when the activation code was created.
deregistered_count This property is required. int
The number of instances that have been logged out.
description This property is required. str
Description of the corresponding activation code.
disabled This property is required. bool
Indicates whether the activation code is disabled.
id This property is required. str
The ID of the Activation.
instance_count This property is required. int
The maximum number of times the activation code is used to register a managed instance.
instance_name This property is required. str
The default prefix of the instance name.
ip_address_range This property is required. str
The IP address of the host that allows the activation code to be used.
registered_count This property is required. int
The number of instances that were registered.
time_to_live_in_hours This property is required. int
The validity period of the activation code. Unit: hours.
activationId This property is required. String
The ID of the activation code.
createTime This property is required. String
The time when the activation code was created.
deregisteredCount This property is required. Number
The number of instances that have been logged out.
description This property is required. String
Description of the corresponding activation code.
disabled This property is required. Boolean
Indicates whether the activation code is disabled.
id This property is required. String
The ID of the Activation.
instanceCount This property is required. Number
The maximum number of times the activation code is used to register a managed instance.
instanceName This property is required. String
The default prefix of the instance name.
ipAddressRange This property is required. String
The IP address of the host that allows the activation code to be used.
registeredCount This property is required. Number
The number of instances that were registered.
timeToLiveInHours This property is required. 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.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi