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

alicloud.maxcompute.getProjects

Explore with Pulumi AI

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

    This data source provides Max Compute Project available to the user.What is Project

    NOTE: Available in 1.196.0+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "tf_testaccmp";
    const defaultProject = new alicloud.maxcompute.Project("default", {
        defaultQuota: "默认后付费Quota",
        projectName: name,
        comment: name,
        productType: "PAYASYOUGO",
    });
    const default = defaultProject.id.apply(id => alicloud.maxcompute.getProjectsOutput({
        ids: [id],
        nameRegex: defaultProject.name,
    }));
    export const alicloudMaxcomputeProjectExampleId = _default.apply(_default => _default.projects?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tf_testaccmp"
    default_project = alicloud.maxcompute.Project("default",
        default_quota="默认后付费Quota",
        project_name=name,
        comment=name,
        product_type="PAYASYOUGO")
    default = default_project.id.apply(lambda id: alicloud.maxcompute.get_projects_output(ids=[id],
        name_regex=default_project.name))
    pulumi.export("alicloudMaxcomputeProjectExampleId", default.projects[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/maxcompute"
    	"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_testaccmp";
    if param := cfg.Get("name"); param != ""{
    name = param
    }
    defaultProject, err := maxcompute.NewProject(ctx, "default", &maxcompute.ProjectArgs{
    DefaultQuota: pulumi.String("默认后付费Quota"),
    ProjectName: pulumi.String(name),
    Comment: pulumi.String(name),
    ProductType: pulumi.String("PAYASYOUGO"),
    })
    if err != nil {
    return err
    }
    _default := defaultProject.ID().ApplyT(func(id string) (maxcompute.GetProjectsResult, error) {
    return maxcompute.GetProjectsOutput(ctx, maxcompute.GetProjectsOutputArgs{
    Ids: []string{
    id,
    },
    NameRegex: defaultProject.Name,
    }, nil), nil
    }).(maxcompute.GetProjectsResultOutput)
    ctx.Export("alicloudMaxcomputeProjectExampleId", _default.ApplyT(func(_default maxcompute.GetProjectsResult) (*string, error) {
    return &default.Projects[0].Id, nil
    }).(pulumi.StringPtrOutput))
    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_testaccmp";
        var defaultProject = new AliCloud.MaxCompute.Project("default", new()
        {
            DefaultQuota = "默认后付费Quota",
            ProjectName = name,
            Comment = name,
            ProductType = "PAYASYOUGO",
        });
    
        var @default = AliCloud.MaxCompute.GetProjects.Invoke(new()
        {
            Ids = new[]
            {
                defaultProject.Id,
            },
            NameRegex = defaultProject.Name,
        });
    
        return new Dictionary<string, object?>
        {
            ["alicloudMaxcomputeProjectExampleId"] = @default.Apply(@default => @default.Apply(getProjectsResult => getProjectsResult.Projects[0]?.Id)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.maxcompute.Project;
    import com.pulumi.alicloud.maxcompute.ProjectArgs;
    import com.pulumi.alicloud.maxcompute.MaxcomputeFunctions;
    import com.pulumi.alicloud.maxcompute.inputs.GetProjectsArgs;
    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_testaccmp");
            var defaultProject = new Project("defaultProject", ProjectArgs.builder()
                .defaultQuota("默认后付费Quota")
                .projectName(name)
                .comment(name)
                .productType("PAYASYOUGO")
                .build());
    
            final var default = MaxcomputeFunctions.getProjects(GetProjectsArgs.builder()
                .ids(defaultProject.id())
                .nameRegex(defaultProject.name())
                .build());
    
            ctx.export("alicloudMaxcomputeProjectExampleId", default_.applyValue(default_ -> default_.projects()[0].id()));
        }
    }
    
    configuration:
      name:
        type: string
        default: tf_testaccmp
    resources:
      defaultProject:
        type: alicloud:maxcompute:Project
        name: default
        properties:
          defaultQuota: 默认后付费Quota
          projectName: ${name}
          comment: ${name}
          productType: PAYASYOUGO
    variables:
      default:
        fn::invoke:
          Function: alicloud:maxcompute:getProjects
          Arguments:
            ids:
              - ${defaultProject.id}
            nameRegex: ${defaultProject.name}
    outputs:
      alicloudMaxcomputeProjectExampleId: ${default.projects[0].id}
    

    Using getProjects

    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 getProjects(args: GetProjectsArgs, opts?: InvokeOptions): Promise<GetProjectsResult>
    function getProjectsOutput(args: GetProjectsOutputArgs, opts?: InvokeOptions): Output<GetProjectsResult>
    def get_projects(ids: Optional[Sequence[str]] = None,
                     name_regex: Optional[str] = None,
                     output_file: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetProjectsResult
    def get_projects_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                     name_regex: Optional[pulumi.Input[str]] = None,
                     output_file: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetProjectsResult]
    func GetProjects(ctx *Context, args *GetProjectsArgs, opts ...InvokeOption) (*GetProjectsResult, error)
    func GetProjectsOutput(ctx *Context, args *GetProjectsOutputArgs, opts ...InvokeOption) GetProjectsResultOutput

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

    public static class GetProjects 
    {
        public static Task<GetProjectsResult> InvokeAsync(GetProjectsArgs args, InvokeOptions? opts = null)
        public static Output<GetProjectsResult> Invoke(GetProjectsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetProjectsResult> getProjects(GetProjectsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:maxcompute/getProjects:getProjects
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Project IDs.
    NameRegex string
    A regex string to filter results by Group Metric Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of Project IDs.
    NameRegex string
    A regex string to filter results by Group Metric Rule name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Project IDs.
    nameRegex String
    A regex string to filter results by Group Metric Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of Project IDs.
    nameRegex string
    A regex string to filter results by Group Metric Rule name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of Project IDs.
    name_regex str
    A regex string to filter results by Group Metric Rule name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Project IDs.
    nameRegex String
    A regex string to filter results by Group Metric Rule name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getProjects Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    A list of Project IDs.
    Names List<string>
    A list of name of Projects.
    Projects List<Pulumi.AliCloud.MaxCompute.Outputs.GetProjectsProject>
    A list of Project Entries. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    A list of Project IDs.
    Names []string
    A list of name of Projects.
    Projects []GetProjectsProject
    A list of Project Entries. Each element contains the following attributes:
    NameRegex string
    OutputFile string
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Project IDs.
    names List<String>
    A list of name of Projects.
    projects List<GetProjectsProject>
    A list of Project Entries. Each element contains the following attributes:
    nameRegex String
    outputFile String
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    A list of Project IDs.
    names string[]
    A list of name of Projects.
    projects GetProjectsProject[]
    A list of Project Entries. Each element contains the following attributes:
    nameRegex string
    outputFile string
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    A list of Project IDs.
    names Sequence[str]
    A list of name of Projects.
    projects Sequence[GetProjectsProject]
    A list of Project Entries. Each element contains the following attributes:
    name_regex str
    output_file str
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    A list of Project IDs.
    names List<String>
    A list of name of Projects.
    projects List<Property Map>
    A list of Project Entries. Each element contains the following attributes:
    nameRegex String
    outputFile String

    Supporting Types

    GetProjectsProject

    Comment string
    DefaultQuota string
    Default Computing Resource Group
    Id string
    Project ID. The value is the same as project_name.
    IpWhiteList Pulumi.AliCloud.MaxCompute.Inputs.GetProjectsProjectIpWhiteList
    IP whitelist
    Owner string
    Project owner
    ProjectName string
    The name of the resource
    Properties Pulumi.AliCloud.MaxCompute.Inputs.GetProjectsProjectProperties
    Project base attributes
    SecurityProperties Pulumi.AliCloud.MaxCompute.Inputs.GetProjectsProjectSecurityProperties
    Security-related attributes
    Status string
    The status of the resource
    Type string
    Project type
    Comment string
    DefaultQuota string
    Default Computing Resource Group
    Id string
    Project ID. The value is the same as project_name.
    IpWhiteList GetProjectsProjectIpWhiteList
    IP whitelist
    Owner string
    Project owner
    ProjectName string
    The name of the resource
    Properties GetProjectsProjectProperties
    Project base attributes
    SecurityProperties GetProjectsProjectSecurityProperties
    Security-related attributes
    Status string
    The status of the resource
    Type string
    Project type
    comment String
    defaultQuota String
    Default Computing Resource Group
    id String
    Project ID. The value is the same as project_name.
    ipWhiteList GetProjectsProjectIpWhiteList
    IP whitelist
    owner String
    Project owner
    projectName String
    The name of the resource
    properties GetProjectsProjectProperties
    Project base attributes
    securityProperties GetProjectsProjectSecurityProperties
    Security-related attributes
    status String
    The status of the resource
    type String
    Project type
    comment string
    defaultQuota string
    Default Computing Resource Group
    id string
    Project ID. The value is the same as project_name.
    ipWhiteList GetProjectsProjectIpWhiteList
    IP whitelist
    owner string
    Project owner
    projectName string
    The name of the resource
    properties GetProjectsProjectProperties
    Project base attributes
    securityProperties GetProjectsProjectSecurityProperties
    Security-related attributes
    status string
    The status of the resource
    type string
    Project type
    comment str
    default_quota str
    Default Computing Resource Group
    id str
    Project ID. The value is the same as project_name.
    ip_white_list GetProjectsProjectIpWhiteList
    IP whitelist
    owner str
    Project owner
    project_name str
    The name of the resource
    properties GetProjectsProjectProperties
    Project base attributes
    security_properties GetProjectsProjectSecurityProperties
    Security-related attributes
    status str
    The status of the resource
    type str
    Project type
    comment String
    defaultQuota String
    Default Computing Resource Group
    id String
    Project ID. The value is the same as project_name.
    ipWhiteList Property Map
    IP whitelist
    owner String
    Project owner
    projectName String
    The name of the resource
    properties Property Map
    Project base attributes
    securityProperties Property Map
    Security-related attributes
    status String
    The status of the resource
    type String
    Project type

    GetProjectsProjectIpWhiteList

    IpList string
    Classic network IP white list.
    VpcIpList string
    VPC network whitelist.
    IpList string
    Classic network IP white list.
    VpcIpList string
    VPC network whitelist.
    ipList String
    Classic network IP white list.
    vpcIpList String
    VPC network whitelist.
    ipList string
    Classic network IP white list.
    vpcIpList string
    VPC network whitelist.
    ip_list str
    Classic network IP white list.
    vpc_ip_list str
    VPC network whitelist.
    ipList String
    Classic network IP white list.
    vpcIpList String
    VPC network whitelist.

    GetProjectsProjectProperties

    AllowFullScan bool
    Whether to allow full table scan.
    EnableDecimal2 bool
    Whether to turn on Decimal2.0.
    Encryption Pulumi.AliCloud.MaxCompute.Inputs.GetProjectsProjectPropertiesEncryption
    Whether encryption is turned on.
    RetentionDays string
    Job default retention time.
    SqlMeteringMax string
    SQL charge limit.
    TableLifecycle Pulumi.AliCloud.MaxCompute.Inputs.GetProjectsProjectPropertiesTableLifecycle
    Life cycle of tables.
    Timezone string
    Project time zone.
    TypeSystem string
    Type system.
    AllowFullScan bool
    Whether to allow full table scan.
    EnableDecimal2 bool
    Whether to turn on Decimal2.0.
    Encryption GetProjectsProjectPropertiesEncryption
    Whether encryption is turned on.
    RetentionDays string
    Job default retention time.
    SqlMeteringMax string
    SQL charge limit.
    TableLifecycle GetProjectsProjectPropertiesTableLifecycle
    Life cycle of tables.
    Timezone string
    Project time zone.
    TypeSystem string
    Type system.
    allowFullScan Boolean
    Whether to allow full table scan.
    enableDecimal2 Boolean
    Whether to turn on Decimal2.0.
    encryption GetProjectsProjectPropertiesEncryption
    Whether encryption is turned on.
    retentionDays String
    Job default retention time.
    sqlMeteringMax String
    SQL charge limit.
    tableLifecycle GetProjectsProjectPropertiesTableLifecycle
    Life cycle of tables.
    timezone String
    Project time zone.
    typeSystem String
    Type system.
    allowFullScan boolean
    Whether to allow full table scan.
    enableDecimal2 boolean
    Whether to turn on Decimal2.0.
    encryption GetProjectsProjectPropertiesEncryption
    Whether encryption is turned on.
    retentionDays string
    Job default retention time.
    sqlMeteringMax string
    SQL charge limit.
    tableLifecycle GetProjectsProjectPropertiesTableLifecycle
    Life cycle of tables.
    timezone string
    Project time zone.
    typeSystem string
    Type system.
    allow_full_scan bool
    Whether to allow full table scan.
    enable_decimal2 bool
    Whether to turn on Decimal2.0.
    encryption GetProjectsProjectPropertiesEncryption
    Whether encryption is turned on.
    retention_days str
    Job default retention time.
    sql_metering_max str
    SQL charge limit.
    table_lifecycle GetProjectsProjectPropertiesTableLifecycle
    Life cycle of tables.
    timezone str
    Project time zone.
    type_system str
    Type system.
    allowFullScan Boolean
    Whether to allow full table scan.
    enableDecimal2 Boolean
    Whether to turn on Decimal2.0.
    encryption Property Map
    Whether encryption is turned on.
    retentionDays String
    Job default retention time.
    sqlMeteringMax String
    SQL charge limit.
    tableLifecycle Property Map
    Life cycle of tables.
    timezone String
    Project time zone.
    typeSystem String
    Type system.

    GetProjectsProjectPropertiesEncryption

    Algorithm string
    Algorithm.
    Enable bool
    Whether to open.
    Key string
    Encryption algorithm key.
    Algorithm string
    Algorithm.
    Enable bool
    Whether to open.
    Key string
    Encryption algorithm key.
    algorithm String
    Algorithm.
    enable Boolean
    Whether to open.
    key String
    Encryption algorithm key.
    algorithm string
    Algorithm.
    enable boolean
    Whether to open.
    key string
    Encryption algorithm key.
    algorithm str
    Algorithm.
    enable bool
    Whether to open.
    key str
    Encryption algorithm key.
    algorithm String
    Algorithm.
    enable Boolean
    Whether to open.
    key String
    Encryption algorithm key.

    GetProjectsProjectPropertiesTableLifecycle

    Type string
    Project type
    Value string
    The value of the life cycle.
    Type string
    Project type
    Value string
    The value of the life cycle.
    type String
    Project type
    value String
    The value of the life cycle.
    type string
    Project type
    value string
    The value of the life cycle.
    type str
    Project type
    value str
    The value of the life cycle.
    type String
    Project type
    value String
    The value of the life cycle.

    GetProjectsProjectSecurityProperties

    EnableDownloadPrivilege bool
    Whether to enable download permission check.
    LabelSecurity bool
    Label authorization.
    ObjectCreatorHasAccessPermission bool
    Project creator permissions.
    ObjectCreatorHasGrantPermission bool
    Does the project creator have authorization rights.
    ProjectProtection Pulumi.AliCloud.MaxCompute.Inputs.GetProjectsProjectSecurityPropertiesProjectProtection
    Project protection.
    UsingAcl bool
    Whether to turn on ACL.
    UsingPolicy bool
    Whether to enable Policy.
    EnableDownloadPrivilege bool
    Whether to enable download permission check.
    LabelSecurity bool
    Label authorization.
    ObjectCreatorHasAccessPermission bool
    Project creator permissions.
    ObjectCreatorHasGrantPermission bool
    Does the project creator have authorization rights.
    ProjectProtection GetProjectsProjectSecurityPropertiesProjectProtection
    Project protection.
    UsingAcl bool
    Whether to turn on ACL.
    UsingPolicy bool
    Whether to enable Policy.
    enableDownloadPrivilege Boolean
    Whether to enable download permission check.
    labelSecurity Boolean
    Label authorization.
    objectCreatorHasAccessPermission Boolean
    Project creator permissions.
    objectCreatorHasGrantPermission Boolean
    Does the project creator have authorization rights.
    projectProtection GetProjectsProjectSecurityPropertiesProjectProtection
    Project protection.
    usingAcl Boolean
    Whether to turn on ACL.
    usingPolicy Boolean
    Whether to enable Policy.
    enableDownloadPrivilege boolean
    Whether to enable download permission check.
    labelSecurity boolean
    Label authorization.
    objectCreatorHasAccessPermission boolean
    Project creator permissions.
    objectCreatorHasGrantPermission boolean
    Does the project creator have authorization rights.
    projectProtection GetProjectsProjectSecurityPropertiesProjectProtection
    Project protection.
    usingAcl boolean
    Whether to turn on ACL.
    usingPolicy boolean
    Whether to enable Policy.
    enable_download_privilege bool
    Whether to enable download permission check.
    label_security bool
    Label authorization.
    object_creator_has_access_permission bool
    Project creator permissions.
    object_creator_has_grant_permission bool
    Does the project creator have authorization rights.
    project_protection GetProjectsProjectSecurityPropertiesProjectProtection
    Project protection.
    using_acl bool
    Whether to turn on ACL.
    using_policy bool
    Whether to enable Policy.
    enableDownloadPrivilege Boolean
    Whether to enable download permission check.
    labelSecurity Boolean
    Label authorization.
    objectCreatorHasAccessPermission Boolean
    Project creator permissions.
    objectCreatorHasGrantPermission Boolean
    Does the project creator have authorization rights.
    projectProtection Property Map
    Project protection.
    usingAcl Boolean
    Whether to turn on ACL.
    usingPolicy Boolean
    Whether to enable Policy.

    GetProjectsProjectSecurityPropertiesProjectProtection

    ExceptionPolicy string
    Exclusion policy.
    Protected bool
    Is it turned on.
    ExceptionPolicy string
    Exclusion policy.
    Protected bool
    Is it turned on.
    exceptionPolicy String
    Exclusion policy.
    protected_ Boolean
    Is it turned on.
    exceptionPolicy string
    Exclusion policy.
    protected boolean
    Is it turned on.
    exception_policy str
    Exclusion policy.
    protected bool
    Is it turned on.
    exceptionPolicy String
    Exclusion policy.
    protected Boolean
    Is it turned on.

    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