1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cdn
  5. getService
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

alicloud.cdn.getService

Explore with Pulumi AI

Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

Using this data source can enable CDN service automatically. If the service has been enabled, it will return Opened.

For information about CDN and how to use it, see What is CDN.

NOTE: Available since v1.98.0.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const open = alicloud.cdn.getService({
    enable: "On",
    internetChargeType: "PayByTraffic",
});
Copy
import pulumi
import pulumi_alicloud as alicloud

open = alicloud.cdn.get_service(enable="On",
    internet_charge_type="PayByTraffic")
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cdn"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cdn.GetService(ctx, &cdn.GetServiceArgs{
			Enable:             pulumi.StringRef("On"),
			InternetChargeType: pulumi.StringRef("PayByTraffic"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var open = AliCloud.Cdn.GetService.Invoke(new()
    {
        Enable = "On",
        InternetChargeType = "PayByTraffic",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cdn.CdnFunctions;
import com.pulumi.alicloud.cdn.inputs.GetServiceArgs;
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 open = CdnFunctions.getService(GetServiceArgs.builder()
            .enable("On")
            .internetChargeType("PayByTraffic")
            .build());

    }
}
Copy
variables:
  open:
    fn::invoke:
      function: alicloud:cdn:getService
      arguments:
        enable: On
        internetChargeType: PayByTraffic
Copy

Using getService

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 getService(args: GetServiceArgs, opts?: InvokeOptions): Promise<GetServiceResult>
function getServiceOutput(args: GetServiceOutputArgs, opts?: InvokeOptions): Output<GetServiceResult>
Copy
def get_service(enable: Optional[str] = None,
                internet_charge_type: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetServiceResult
def get_service_output(enable: Optional[pulumi.Input[str]] = None,
                internet_charge_type: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetServiceResult]
Copy
func GetService(ctx *Context, args *GetServiceArgs, opts ...InvokeOption) (*GetServiceResult, error)
func GetServiceOutput(ctx *Context, args *GetServiceOutputArgs, opts ...InvokeOption) GetServiceResultOutput
Copy

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

public static class GetService 
{
    public static Task<GetServiceResult> InvokeAsync(GetServiceArgs args, InvokeOptions? opts = null)
    public static Output<GetServiceResult> Invoke(GetServiceInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetServiceResult> getService(GetServiceArgs args, InvokeOptions options)
public static Output<GetServiceResult> getService(GetServiceArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:cdn/getService:getService
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Enable string
Setting the value to On to enable the service. If has been enabled, return the result. Valid values: "On" or "Off". Default to "Off".
InternetChargeType string

The new billing method. Valid values: PayByTraffic and PayByBandwidth. Default value: PayByTraffic. It is required when enable = on. If the CDN service has been opened and you can update its internet charge type by modifying the filed internet_charge_type. As a note, the updated internet charge type will be effective in the next day zero time.

NOTE: Setting enable = "On" to open the CDN service that means you have read and agreed the CDN Terms of Service. The service can not closed once it is opened.

Enable string
Setting the value to On to enable the service. If has been enabled, return the result. Valid values: "On" or "Off". Default to "Off".
InternetChargeType string

The new billing method. Valid values: PayByTraffic and PayByBandwidth. Default value: PayByTraffic. It is required when enable = on. If the CDN service has been opened and you can update its internet charge type by modifying the filed internet_charge_type. As a note, the updated internet charge type will be effective in the next day zero time.

NOTE: Setting enable = "On" to open the CDN service that means you have read and agreed the CDN Terms of Service. The service can not closed once it is opened.

enable String
Setting the value to On to enable the service. If has been enabled, return the result. Valid values: "On" or "Off". Default to "Off".
internetChargeType String

The new billing method. Valid values: PayByTraffic and PayByBandwidth. Default value: PayByTraffic. It is required when enable = on. If the CDN service has been opened and you can update its internet charge type by modifying the filed internet_charge_type. As a note, the updated internet charge type will be effective in the next day zero time.

NOTE: Setting enable = "On" to open the CDN service that means you have read and agreed the CDN Terms of Service. The service can not closed once it is opened.

enable string
Setting the value to On to enable the service. If has been enabled, return the result. Valid values: "On" or "Off". Default to "Off".
internetChargeType string

The new billing method. Valid values: PayByTraffic and PayByBandwidth. Default value: PayByTraffic. It is required when enable = on. If the CDN service has been opened and you can update its internet charge type by modifying the filed internet_charge_type. As a note, the updated internet charge type will be effective in the next day zero time.

NOTE: Setting enable = "On" to open the CDN service that means you have read and agreed the CDN Terms of Service. The service can not closed once it is opened.

enable str
Setting the value to On to enable the service. If has been enabled, return the result. Valid values: "On" or "Off". Default to "Off".
internet_charge_type str

The new billing method. Valid values: PayByTraffic and PayByBandwidth. Default value: PayByTraffic. It is required when enable = on. If the CDN service has been opened and you can update its internet charge type by modifying the filed internet_charge_type. As a note, the updated internet charge type will be effective in the next day zero time.

NOTE: Setting enable = "On" to open the CDN service that means you have read and agreed the CDN Terms of Service. The service can not closed once it is opened.

enable String
Setting the value to On to enable the service. If has been enabled, return the result. Valid values: "On" or "Off". Default to "Off".
internetChargeType String

The new billing method. Valid values: PayByTraffic and PayByBandwidth. Default value: PayByTraffic. It is required when enable = on. If the CDN service has been opened and you can update its internet charge type by modifying the filed internet_charge_type. As a note, the updated internet charge type will be effective in the next day zero time.

NOTE: Setting enable = "On" to open the CDN service that means you have read and agreed the CDN Terms of Service. The service can not closed once it is opened.

getService Result

The following output properties are available:

ChangingAffectTime string
The time when the change of the billing method starts to take effect. The time is displayed in GMT.
ChangingChargeType string
The billing method to be effective.
Id string
The provider-assigned unique ID for this managed resource.
OpeningTime string
The time when the CDN service was activated. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mmZ format.
Status string
The current service enable status.
Enable string
InternetChargeType string
ChangingAffectTime string
The time when the change of the billing method starts to take effect. The time is displayed in GMT.
ChangingChargeType string
The billing method to be effective.
Id string
The provider-assigned unique ID for this managed resource.
OpeningTime string
The time when the CDN service was activated. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mmZ format.
Status string
The current service enable status.
Enable string
InternetChargeType string
changingAffectTime String
The time when the change of the billing method starts to take effect. The time is displayed in GMT.
changingChargeType String
The billing method to be effective.
id String
The provider-assigned unique ID for this managed resource.
openingTime String
The time when the CDN service was activated. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mmZ format.
status String
The current service enable status.
enable String
internetChargeType String
changingAffectTime string
The time when the change of the billing method starts to take effect. The time is displayed in GMT.
changingChargeType string
The billing method to be effective.
id string
The provider-assigned unique ID for this managed resource.
openingTime string
The time when the CDN service was activated. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mmZ format.
status string
The current service enable status.
enable string
internetChargeType string
changing_affect_time str
The time when the change of the billing method starts to take effect. The time is displayed in GMT.
changing_charge_type str
The billing method to be effective.
id str
The provider-assigned unique ID for this managed resource.
opening_time str
The time when the CDN service was activated. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mmZ format.
status str
The current service enable status.
enable str
internet_charge_type str
changingAffectTime String
The time when the change of the billing method starts to take effect. The time is displayed in GMT.
changingChargeType String
The billing method to be effective.
id String
The provider-assigned unique ID for this managed resource.
openingTime String
The time when the CDN service was activated. The time follows the ISO 8601 standard in the yyyy-MM-ddThh:mmZ format.
status String
The current service enable status.
enable String
internetChargeType String

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.75.0 published on Friday, Mar 7, 2025 by Pulumi