1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. sms
  5. ShortUrl
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

alicloud.sms.ShortUrl

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.57.1 published on Wednesday, Jun 26, 2024 by Pulumi

    Provides a SMS Short Url resource.

    For information about SMS Short Url and how to use it, see What is Short Url.

    NOTE: Available in v1.178.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const example = new alicloud.sms.ShortUrl("example", {
        effectiveDays: 30,
        shortUrlName: "example_value",
        sourceUrl: "example_value",
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    example = alicloud.sms.ShortUrl("example",
        effective_days=30,
        short_url_name="example_value",
        source_url="example_value")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/sms"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sms.NewShortUrl(ctx, "example", &sms.ShortUrlArgs{
    			EffectiveDays: pulumi.Int(30),
    			ShortUrlName:  pulumi.String("example_value"),
    			SourceUrl:     pulumi.String("example_value"),
    		})
    		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 example = new AliCloud.Sms.ShortUrl("example", new()
        {
            EffectiveDays = 30,
            ShortUrlName = "example_value",
            SourceUrl = "example_value",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.sms.ShortUrl;
    import com.pulumi.alicloud.sms.ShortUrlArgs;
    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 example = new ShortUrl("example", ShortUrlArgs.builder()
                .effectiveDays(30)
                .shortUrlName("example_value")
                .sourceUrl("example_value")
                .build());
    
        }
    }
    
    resources:
      example:
        type: alicloud:sms:ShortUrl
        properties:
          effectiveDays: 30
          shortUrlName: example_value
          sourceUrl: example_value
    

    Create ShortUrl Resource

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

    Constructor syntax

    new ShortUrl(name: string, args: ShortUrlArgs, opts?: CustomResourceOptions);
    @overload
    def ShortUrl(resource_name: str,
                 args: ShortUrlArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def ShortUrl(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 effective_days: Optional[int] = None,
                 short_url_name: Optional[str] = None,
                 source_url: Optional[str] = None)
    func NewShortUrl(ctx *Context, name string, args ShortUrlArgs, opts ...ResourceOption) (*ShortUrl, error)
    public ShortUrl(string name, ShortUrlArgs args, CustomResourceOptions? opts = null)
    public ShortUrl(String name, ShortUrlArgs args)
    public ShortUrl(String name, ShortUrlArgs args, CustomResourceOptions options)
    
    type: alicloud:sms:ShortUrl
    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 ShortUrlArgs
    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 ShortUrlArgs
    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 ShortUrlArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ShortUrlArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ShortUrlArgs
    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 shortUrlResource = new AliCloud.Sms.ShortUrl("shortUrlResource", new()
    {
        EffectiveDays = 0,
        ShortUrlName = "string",
        SourceUrl = "string",
    });
    
    example, err := sms.NewShortUrl(ctx, "shortUrlResource", &sms.ShortUrlArgs{
    	EffectiveDays: pulumi.Int(0),
    	ShortUrlName:  pulumi.String("string"),
    	SourceUrl:     pulumi.String("string"),
    })
    
    var shortUrlResource = new ShortUrl("shortUrlResource", ShortUrlArgs.builder()
        .effectiveDays(0)
        .shortUrlName("string")
        .sourceUrl("string")
        .build());
    
    short_url_resource = alicloud.sms.ShortUrl("shortUrlResource",
        effective_days=0,
        short_url_name="string",
        source_url="string")
    
    const shortUrlResource = new alicloud.sms.ShortUrl("shortUrlResource", {
        effectiveDays: 0,
        shortUrlName: "string",
        sourceUrl: "string",
    });
    
    type: alicloud:sms:ShortUrl
    properties:
        effectiveDays: 0
        shortUrlName: string
        sourceUrl: string
    

    ShortUrl 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 ShortUrl resource accepts the following input properties:

    EffectiveDays int
    Short chain service use validity period. Valid values: 30, 60, 90. The unit is days, and the maximum validity period is 90 days.
    ShortUrlName string
    The name of the resource.
    SourceUrl string
    The original link address.
    EffectiveDays int
    Short chain service use validity period. Valid values: 30, 60, 90. The unit is days, and the maximum validity period is 90 days.
    ShortUrlName string
    The name of the resource.
    SourceUrl string
    The original link address.
    effectiveDays Integer
    Short chain service use validity period. Valid values: 30, 60, 90. The unit is days, and the maximum validity period is 90 days.
    shortUrlName String
    The name of the resource.
    sourceUrl String
    The original link address.
    effectiveDays number
    Short chain service use validity period. Valid values: 30, 60, 90. The unit is days, and the maximum validity period is 90 days.
    shortUrlName string
    The name of the resource.
    sourceUrl string
    The original link address.
    effective_days int
    Short chain service use validity period. Valid values: 30, 60, 90. The unit is days, and the maximum validity period is 90 days.
    short_url_name str
    The name of the resource.
    source_url str
    The original link address.
    effectiveDays Number
    Short chain service use validity period. Valid values: 30, 60, 90. The unit is days, and the maximum validity period is 90 days.
    shortUrlName String
    The name of the resource.
    sourceUrl String
    The original link address.

    Outputs

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

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

    Look up Existing ShortUrl Resource

    Get an existing ShortUrl 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?: ShortUrlState, opts?: CustomResourceOptions): ShortUrl
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            effective_days: Optional[int] = None,
            short_url_name: Optional[str] = None,
            source_url: Optional[str] = None,
            status: Optional[str] = None) -> ShortUrl
    func GetShortUrl(ctx *Context, name string, id IDInput, state *ShortUrlState, opts ...ResourceOption) (*ShortUrl, error)
    public static ShortUrl Get(string name, Input<string> id, ShortUrlState? state, CustomResourceOptions? opts = null)
    public static ShortUrl get(String name, Output<String> id, ShortUrlState 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:
    EffectiveDays int
    Short chain service use validity period. Valid values: 30, 60, 90. The unit is days, and the maximum validity period is 90 days.
    ShortUrlName string
    The name of the resource.
    SourceUrl string
    The original link address.
    Status string
    Short chain status.
    EffectiveDays int
    Short chain service use validity period. Valid values: 30, 60, 90. The unit is days, and the maximum validity period is 90 days.
    ShortUrlName string
    The name of the resource.
    SourceUrl string
    The original link address.
    Status string
    Short chain status.
    effectiveDays Integer
    Short chain service use validity period. Valid values: 30, 60, 90. The unit is days, and the maximum validity period is 90 days.
    shortUrlName String
    The name of the resource.
    sourceUrl String
    The original link address.
    status String
    Short chain status.
    effectiveDays number
    Short chain service use validity period. Valid values: 30, 60, 90. The unit is days, and the maximum validity period is 90 days.
    shortUrlName string
    The name of the resource.
    sourceUrl string
    The original link address.
    status string
    Short chain status.
    effective_days int
    Short chain service use validity period. Valid values: 30, 60, 90. The unit is days, and the maximum validity period is 90 days.
    short_url_name str
    The name of the resource.
    source_url str
    The original link address.
    status str
    Short chain status.
    effectiveDays Number
    Short chain service use validity period. Valid values: 30, 60, 90. The unit is days, and the maximum validity period is 90 days.
    shortUrlName String
    The name of the resource.
    sourceUrl String
    The original link address.
    status String
    Short chain status.

    Import

    SMS Short Url can be imported using the id, e.g.

    $ pulumi import alicloud:sms/shortUrl:ShortUrl 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.57.1 published on Wednesday, Jun 26, 2024 by Pulumi