1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. oos
  5. ServiceSetting
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

alicloud.oos.ServiceSetting

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.53.0 published on Wednesday, Apr 17, 2024 by Pulumi

    Provides a OOS Service Setting resource.

    For information about OOS Service Setting and how to use it, see What is Service Setting.

    NOTE: Available in v1.147.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") || "tf-testaccoossetting";
    const defaultBucket = new alicloud.oss.Bucket("defaultBucket", {
        bucket: name,
        acl: "public-read-write",
    });
    const defaultProject = new alicloud.log.Project("defaultProject", {});
    const defaultServiceSetting = new alicloud.oos.ServiceSetting("defaultServiceSetting", {
        deliveryOssEnabled: true,
        deliveryOssKeyPrefix: "path1/",
        deliveryOssBucketName: defaultBucket.bucket,
        deliverySlsEnabled: true,
        deliverySlsProjectName: defaultProject.name,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf-testaccoossetting"
    default_bucket = alicloud.oss.Bucket("defaultBucket",
        bucket=name,
        acl="public-read-write")
    default_project = alicloud.log.Project("defaultProject")
    default_service_setting = alicloud.oos.ServiceSetting("defaultServiceSetting",
        delivery_oss_enabled=True,
        delivery_oss_key_prefix="path1/",
        delivery_oss_bucket_name=default_bucket.bucket,
        delivery_sls_enabled=True,
        delivery_sls_project_name=default_project.name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oos"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/oss"
    	"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 := "tf-testaccoossetting"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		defaultBucket, err := oss.NewBucket(ctx, "defaultBucket", &oss.BucketArgs{
    			Bucket: pulumi.String(name),
    			Acl:    pulumi.String("public-read-write"),
    		})
    		if err != nil {
    			return err
    		}
    		defaultProject, err := log.NewProject(ctx, "defaultProject", nil)
    		if err != nil {
    			return err
    		}
    		_, err = oos.NewServiceSetting(ctx, "defaultServiceSetting", &oos.ServiceSettingArgs{
    			DeliveryOssEnabled:     pulumi.Bool(true),
    			DeliveryOssKeyPrefix:   pulumi.String("path1/"),
    			DeliveryOssBucketName:  defaultBucket.Bucket,
    			DeliverySlsEnabled:     pulumi.Bool(true),
    			DeliverySlsProjectName: defaultProject.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") ?? "tf-testaccoossetting";
        var defaultBucket = new AliCloud.Oss.Bucket("defaultBucket", new()
        {
            BucketName = name,
            Acl = "public-read-write",
        });
    
        var defaultProject = new AliCloud.Log.Project("defaultProject");
    
        var defaultServiceSetting = new AliCloud.Oos.ServiceSetting("defaultServiceSetting", new()
        {
            DeliveryOssEnabled = true,
            DeliveryOssKeyPrefix = "path1/",
            DeliveryOssBucketName = defaultBucket.BucketName,
            DeliverySlsEnabled = true,
            DeliverySlsProjectName = defaultProject.Name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.oss.Bucket;
    import com.pulumi.alicloud.oss.BucketArgs;
    import com.pulumi.alicloud.log.Project;
    import com.pulumi.alicloud.oos.ServiceSetting;
    import com.pulumi.alicloud.oos.ServiceSettingArgs;
    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("tf-testaccoossetting");
            var defaultBucket = new Bucket("defaultBucket", BucketArgs.builder()        
                .bucket(name)
                .acl("public-read-write")
                .build());
    
            var defaultProject = new Project("defaultProject");
    
            var defaultServiceSetting = new ServiceSetting("defaultServiceSetting", ServiceSettingArgs.builder()        
                .deliveryOssEnabled(true)
                .deliveryOssKeyPrefix("path1/")
                .deliveryOssBucketName(defaultBucket.bucket())
                .deliverySlsEnabled(true)
                .deliverySlsProjectName(defaultProject.name())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tf-testaccoossetting
    resources:
      defaultBucket:
        type: alicloud:oss:Bucket
        properties:
          bucket: ${name}
          acl: public-read-write
      defaultProject:
        type: alicloud:log:Project
      defaultServiceSetting:
        type: alicloud:oos:ServiceSetting
        properties:
          deliveryOssEnabled: true
          deliveryOssKeyPrefix: path1/
          deliveryOssBucketName: ${defaultBucket.bucket}
          deliverySlsEnabled: true
          deliverySlsProjectName: ${defaultProject.name}
    

    Create ServiceSetting Resource

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

    Constructor syntax

    new ServiceSetting(name: string, args?: ServiceSettingArgs, opts?: CustomResourceOptions);
    @overload
    def ServiceSetting(resource_name: str,
                       args: Optional[ServiceSettingArgs] = None,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def ServiceSetting(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       delivery_oss_bucket_name: Optional[str] = None,
                       delivery_oss_enabled: Optional[bool] = None,
                       delivery_oss_key_prefix: Optional[str] = None,
                       delivery_sls_enabled: Optional[bool] = None,
                       delivery_sls_project_name: Optional[str] = None)
    func NewServiceSetting(ctx *Context, name string, args *ServiceSettingArgs, opts ...ResourceOption) (*ServiceSetting, error)
    public ServiceSetting(string name, ServiceSettingArgs? args = null, CustomResourceOptions? opts = null)
    public ServiceSetting(String name, ServiceSettingArgs args)
    public ServiceSetting(String name, ServiceSettingArgs args, CustomResourceOptions options)
    
    type: alicloud:oos:ServiceSetting
    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 ServiceSettingArgs
    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 ServiceSettingArgs
    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 ServiceSettingArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServiceSettingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServiceSettingArgs
    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 serviceSettingResource = new AliCloud.Oos.ServiceSetting("serviceSettingResource", new()
    {
        DeliveryOssBucketName = "string",
        DeliveryOssEnabled = false,
        DeliveryOssKeyPrefix = "string",
        DeliverySlsEnabled = false,
        DeliverySlsProjectName = "string",
    });
    
    example, err := oos.NewServiceSetting(ctx, "serviceSettingResource", &oos.ServiceSettingArgs{
    	DeliveryOssBucketName:  pulumi.String("string"),
    	DeliveryOssEnabled:     pulumi.Bool(false),
    	DeliveryOssKeyPrefix:   pulumi.String("string"),
    	DeliverySlsEnabled:     pulumi.Bool(false),
    	DeliverySlsProjectName: pulumi.String("string"),
    })
    
    var serviceSettingResource = new ServiceSetting("serviceSettingResource", ServiceSettingArgs.builder()        
        .deliveryOssBucketName("string")
        .deliveryOssEnabled(false)
        .deliveryOssKeyPrefix("string")
        .deliverySlsEnabled(false)
        .deliverySlsProjectName("string")
        .build());
    
    service_setting_resource = alicloud.oos.ServiceSetting("serviceSettingResource",
        delivery_oss_bucket_name="string",
        delivery_oss_enabled=False,
        delivery_oss_key_prefix="string",
        delivery_sls_enabled=False,
        delivery_sls_project_name="string")
    
    const serviceSettingResource = new alicloud.oos.ServiceSetting("serviceSettingResource", {
        deliveryOssBucketName: "string",
        deliveryOssEnabled: false,
        deliveryOssKeyPrefix: "string",
        deliverySlsEnabled: false,
        deliverySlsProjectName: "string",
    });
    
    type: alicloud:oos:ServiceSetting
    properties:
        deliveryOssBucketName: string
        deliveryOssEnabled: false
        deliveryOssKeyPrefix: string
        deliverySlsEnabled: false
        deliverySlsProjectName: string
    

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

    DeliveryOssBucketName string
    The name of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    DeliveryOssEnabled bool
    Is the recording function for the OSS delivery template enabled.
    DeliveryOssKeyPrefix string
    The Directory of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    DeliverySlsEnabled bool
    Is the execution record function to SLS delivery Template turned on.
    DeliverySlsProjectName string
    The name of SLS Project. NOTE: When the delivery_sls_enabled is true, The delivery_sls_project_name is valid.
    DeliveryOssBucketName string
    The name of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    DeliveryOssEnabled bool
    Is the recording function for the OSS delivery template enabled.
    DeliveryOssKeyPrefix string
    The Directory of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    DeliverySlsEnabled bool
    Is the execution record function to SLS delivery Template turned on.
    DeliverySlsProjectName string
    The name of SLS Project. NOTE: When the delivery_sls_enabled is true, The delivery_sls_project_name is valid.
    deliveryOssBucketName String
    The name of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    deliveryOssEnabled Boolean
    Is the recording function for the OSS delivery template enabled.
    deliveryOssKeyPrefix String
    The Directory of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    deliverySlsEnabled Boolean
    Is the execution record function to SLS delivery Template turned on.
    deliverySlsProjectName String
    The name of SLS Project. NOTE: When the delivery_sls_enabled is true, The delivery_sls_project_name is valid.
    deliveryOssBucketName string
    The name of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    deliveryOssEnabled boolean
    Is the recording function for the OSS delivery template enabled.
    deliveryOssKeyPrefix string
    The Directory of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    deliverySlsEnabled boolean
    Is the execution record function to SLS delivery Template turned on.
    deliverySlsProjectName string
    The name of SLS Project. NOTE: When the delivery_sls_enabled is true, The delivery_sls_project_name is valid.
    delivery_oss_bucket_name str
    The name of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    delivery_oss_enabled bool
    Is the recording function for the OSS delivery template enabled.
    delivery_oss_key_prefix str
    The Directory of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    delivery_sls_enabled bool
    Is the execution record function to SLS delivery Template turned on.
    delivery_sls_project_name str
    The name of SLS Project. NOTE: When the delivery_sls_enabled is true, The delivery_sls_project_name is valid.
    deliveryOssBucketName String
    The name of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    deliveryOssEnabled Boolean
    Is the recording function for the OSS delivery template enabled.
    deliveryOssKeyPrefix String
    The Directory of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    deliverySlsEnabled Boolean
    Is the execution record function to SLS delivery Template turned on.
    deliverySlsProjectName String
    The name of SLS Project. NOTE: When the delivery_sls_enabled is true, The delivery_sls_project_name is valid.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ServiceSetting 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 ServiceSetting Resource

    Get an existing ServiceSetting 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?: ServiceSettingState, opts?: CustomResourceOptions): ServiceSetting
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            delivery_oss_bucket_name: Optional[str] = None,
            delivery_oss_enabled: Optional[bool] = None,
            delivery_oss_key_prefix: Optional[str] = None,
            delivery_sls_enabled: Optional[bool] = None,
            delivery_sls_project_name: Optional[str] = None) -> ServiceSetting
    func GetServiceSetting(ctx *Context, name string, id IDInput, state *ServiceSettingState, opts ...ResourceOption) (*ServiceSetting, error)
    public static ServiceSetting Get(string name, Input<string> id, ServiceSettingState? state, CustomResourceOptions? opts = null)
    public static ServiceSetting get(String name, Output<String> id, ServiceSettingState 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:
    DeliveryOssBucketName string
    The name of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    DeliveryOssEnabled bool
    Is the recording function for the OSS delivery template enabled.
    DeliveryOssKeyPrefix string
    The Directory of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    DeliverySlsEnabled bool
    Is the execution record function to SLS delivery Template turned on.
    DeliverySlsProjectName string
    The name of SLS Project. NOTE: When the delivery_sls_enabled is true, The delivery_sls_project_name is valid.
    DeliveryOssBucketName string
    The name of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    DeliveryOssEnabled bool
    Is the recording function for the OSS delivery template enabled.
    DeliveryOssKeyPrefix string
    The Directory of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    DeliverySlsEnabled bool
    Is the execution record function to SLS delivery Template turned on.
    DeliverySlsProjectName string
    The name of SLS Project. NOTE: When the delivery_sls_enabled is true, The delivery_sls_project_name is valid.
    deliveryOssBucketName String
    The name of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    deliveryOssEnabled Boolean
    Is the recording function for the OSS delivery template enabled.
    deliveryOssKeyPrefix String
    The Directory of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    deliverySlsEnabled Boolean
    Is the execution record function to SLS delivery Template turned on.
    deliverySlsProjectName String
    The name of SLS Project. NOTE: When the delivery_sls_enabled is true, The delivery_sls_project_name is valid.
    deliveryOssBucketName string
    The name of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    deliveryOssEnabled boolean
    Is the recording function for the OSS delivery template enabled.
    deliveryOssKeyPrefix string
    The Directory of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    deliverySlsEnabled boolean
    Is the execution record function to SLS delivery Template turned on.
    deliverySlsProjectName string
    The name of SLS Project. NOTE: When the delivery_sls_enabled is true, The delivery_sls_project_name is valid.
    delivery_oss_bucket_name str
    The name of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    delivery_oss_enabled bool
    Is the recording function for the OSS delivery template enabled.
    delivery_oss_key_prefix str
    The Directory of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    delivery_sls_enabled bool
    Is the execution record function to SLS delivery Template turned on.
    delivery_sls_project_name str
    The name of SLS Project. NOTE: When the delivery_sls_enabled is true, The delivery_sls_project_name is valid.
    deliveryOssBucketName String
    The name of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    deliveryOssEnabled Boolean
    Is the recording function for the OSS delivery template enabled.
    deliveryOssKeyPrefix String
    The Directory of the OSS bucket. NOTE: When the delivery_oss_enabled is true, The delivery_oss_bucket_name is valid.
    deliverySlsEnabled Boolean
    Is the execution record function to SLS delivery Template turned on.
    deliverySlsProjectName String
    The name of SLS Project. NOTE: When the delivery_sls_enabled is true, The delivery_sls_project_name is valid.

    Import

    OOS Service Setting can be imported using the id, e.g.

    $ pulumi import alicloud:oos/serviceSetting:ServiceSetting 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.53.0 published on Wednesday, Apr 17, 2024 by Pulumi