1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. log
  5. Project
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

alicloud.log.Project

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.52.1 published on Thursday, Apr 4, 2024 by Pulumi

    Provides a SLS Project resource.

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

    NOTE: Available since v1.9.5.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    
    const _default = new random.RandomInteger("default", {
        max: 99999,
        min: 10000,
    });
    const example = new alicloud.log.Project("example", {
        description: "terraform-example",
        tags: {
            Created: "TF",
            For: "example",
        },
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    default = random.RandomInteger("default",
        max=99999,
        min=10000)
    example = alicloud.log.Project("example",
        description="terraform-example",
        tags={
            "Created": "TF",
            "For": "example",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := random.NewRandomInteger(ctx, "default", &random.RandomIntegerArgs{
    			Max: pulumi.Int(99999),
    			Min: pulumi.Int(10000),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = log.NewProject(ctx, "example", &log.ProjectArgs{
    			Description: pulumi.String("terraform-example"),
    			Tags: pulumi.Map{
    				"Created": pulumi.Any("TF"),
    				"For":     pulumi.Any("example"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new Random.RandomInteger("default", new()
        {
            Max = 99999,
            Min = 10000,
        });
    
        var example = new AliCloud.Log.Project("example", new()
        {
            Description = "terraform-example",
            Tags = 
            {
                { "Created", "TF" },
                { "For", "example" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.random.RandomInteger;
    import com.pulumi.random.RandomIntegerArgs;
    import com.pulumi.alicloud.log.Project;
    import com.pulumi.alicloud.log.ProjectArgs;
    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 default_ = new RandomInteger("default", RandomIntegerArgs.builder()        
                .max(99999)
                .min(10000)
                .build());
    
            var example = new Project("example", ProjectArgs.builder()        
                .description("terraform-example")
                .tags(Map.ofEntries(
                    Map.entry("Created", "TF"),
                    Map.entry("For", "example")
                ))
                .build());
    
        }
    }
    
    resources:
      default:
        type: random:RandomInteger
        properties:
          max: 99999
          min: 10000
      example:
        type: alicloud:log:Project
        properties:
          description: terraform-example
          tags:
            Created: TF
            For: example
    

    Project With Policy Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    import * as random from "@pulumi/random";
    
    const _default = new random.RandomInteger("default", {
        max: 99999,
        min: 10000,
    });
    const examplePolicy = new alicloud.log.Project("examplePolicy", {
        description: "terraform-example",
        policy: `{
      "Statement": [
        {
          "Action": [
            "log:PostLogStoreLogs"
          ],
          "Condition": {
            "StringNotLike": {
              "acs:SourceVpc": [
                "vpc-*"
              ]
            }
          },
          "Effect": "Deny",
          "Resource": "acs:log:*:*:project/tf-log/*"
        }
      ],
      "Version": "1"
    }
    
    `,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    import pulumi_random as random
    
    default = random.RandomInteger("default",
        max=99999,
        min=10000)
    example_policy = alicloud.log.Project("examplePolicy",
        description="terraform-example",
        policy="""{
      "Statement": [
        {
          "Action": [
            "log:PostLogStoreLogs"
          ],
          "Condition": {
            "StringNotLike": {
              "acs:SourceVpc": [
                "vpc-*"
              ]
            }
          },
          "Effect": "Deny",
          "Resource": "acs:log:*:*:project/tf-log/*"
        }
      ],
      "Version": "1"
    }
    
    """)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
    	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := random.NewRandomInteger(ctx, "default", &random.RandomIntegerArgs{
    			Max: pulumi.Int(99999),
    			Min: pulumi.Int(10000),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = log.NewProject(ctx, "examplePolicy", &log.ProjectArgs{
    			Description: pulumi.String("terraform-example"),
    			Policy: pulumi.String(`{
      "Statement": [
        {
          "Action": [
            "log:PostLogStoreLogs"
          ],
          "Condition": {
            "StringNotLike": {
              "acs:SourceVpc": [
                "vpc-*"
              ]
            }
          },
          "Effect": "Deny",
          "Resource": "acs:log:*:*:project/tf-log/*"
        }
      ],
      "Version": "1"
    }
    
    `),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    using Random = Pulumi.Random;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new Random.RandomInteger("default", new()
        {
            Max = 99999,
            Min = 10000,
        });
    
        var examplePolicy = new AliCloud.Log.Project("examplePolicy", new()
        {
            Description = "terraform-example",
            Policy = @"{
      ""Statement"": [
        {
          ""Action"": [
            ""log:PostLogStoreLogs""
          ],
          ""Condition"": {
            ""StringNotLike"": {
              ""acs:SourceVpc"": [
                ""vpc-*""
              ]
            }
          },
          ""Effect"": ""Deny"",
          ""Resource"": ""acs:log:*:*:project/tf-log/*""
        }
      ],
      ""Version"": ""1""
    }
    
    ",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.random.RandomInteger;
    import com.pulumi.random.RandomIntegerArgs;
    import com.pulumi.alicloud.log.Project;
    import com.pulumi.alicloud.log.ProjectArgs;
    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 default_ = new RandomInteger("default", RandomIntegerArgs.builder()        
                .max(99999)
                .min(10000)
                .build());
    
            var examplePolicy = new Project("examplePolicy", ProjectArgs.builder()        
                .description("terraform-example")
                .policy("""
    {
      "Statement": [
        {
          "Action": [
            "log:PostLogStoreLogs"
          ],
          "Condition": {
            "StringNotLike": {
              "acs:SourceVpc": [
                "vpc-*"
              ]
            }
          },
          "Effect": "Deny",
          "Resource": "acs:log:*:*:project/tf-log/*"
        }
      ],
      "Version": "1"
    }
    
                """)
                .build());
    
        }
    }
    
    resources:
      default:
        type: random:RandomInteger
        properties:
          max: 99999
          min: 10000
      examplePolicy:
        type: alicloud:log:Project
        properties:
          description: terraform-example
          policy: |+
            {
              "Statement": [
                {
                  "Action": [
                    "log:PostLogStoreLogs"
                  ],
                  "Condition": {
                    "StringNotLike": {
                      "acs:SourceVpc": [
                        "vpc-*"
                      ]
                    }
                  },
                  "Effect": "Deny",
                  "Resource": "acs:log:*:*:project/tf-log/*"
                }
              ],
              "Version": "1"
            }        
    

    Module Support

    You can use the existing sls module to create SLS project, store and store index one-click, like ECS instances.

    Create Project Resource

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

    Constructor syntax

    new Project(name: string, args?: ProjectArgs, opts?: CustomResourceOptions);
    @overload
    def Project(resource_name: str,
                args: Optional[ProjectArgs] = None,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Project(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                description: Optional[str] = None,
                name: Optional[str] = None,
                policy: Optional[str] = None,
                project_name: Optional[str] = None,
                resource_group_id: Optional[str] = None,
                tags: Optional[Mapping[str, Any]] = None)
    func NewProject(ctx *Context, name string, args *ProjectArgs, opts ...ResourceOption) (*Project, error)
    public Project(string name, ProjectArgs? args = null, CustomResourceOptions? opts = null)
    public Project(String name, ProjectArgs args)
    public Project(String name, ProjectArgs args, CustomResourceOptions options)
    
    type: alicloud:log:Project
    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 ProjectArgs
    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 ProjectArgs
    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 ProjectArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectArgs
    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 exampleprojectResourceResourceFromLogproject = new AliCloud.Log.Project("exampleprojectResourceResourceFromLogproject", new()
    {
        Description = "string",
        Policy = "string",
        ProjectName = "string",
        ResourceGroupId = "string",
        Tags = 
        {
            { "string", "any" },
        },
    });
    
    example, err := log.NewProject(ctx, "exampleprojectResourceResourceFromLogproject", &log.ProjectArgs{
    	Description:     pulumi.String("string"),
    	Policy:          pulumi.String("string"),
    	ProjectName:     pulumi.String("string"),
    	ResourceGroupId: pulumi.String("string"),
    	Tags: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    })
    
    var exampleprojectResourceResourceFromLogproject = new Project("exampleprojectResourceResourceFromLogproject", ProjectArgs.builder()        
        .description("string")
        .policy("string")
        .projectName("string")
        .resourceGroupId("string")
        .tags(Map.of("string", "any"))
        .build());
    
    exampleproject_resource_resource_from_logproject = alicloud.log.Project("exampleprojectResourceResourceFromLogproject",
        description="string",
        policy="string",
        project_name="string",
        resource_group_id="string",
        tags={
            "string": "any",
        })
    
    const exampleprojectResourceResourceFromLogproject = new alicloud.log.Project("exampleprojectResourceResourceFromLogproject", {
        description: "string",
        policy: "string",
        projectName: "string",
        resourceGroupId: "string",
        tags: {
            string: "any",
        },
    });
    
    type: alicloud:log:Project
    properties:
        description: string
        policy: string
        projectName: string
        resourceGroupId: string
        tags:
            string: any
    

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

    Description string
    Description of the log project.
    Name string
    . Field 'name' has been deprecated from provider version 1.212.0. New field 'project_name' instead.

    Deprecated: Field 'name' has been deprecated since provider version 1.212.0. New field 'project_name' instead.

    Policy string
    Log project policy, used to set a policy for a project.
    ProjectName string
    The name of the log project. It is the only in one Alicloud account.
    ResourceGroupId string
    The ID of the resource group.
    Tags Dictionary<string, object>

    Tag.

    The following arguments will be discarded. Please use new fields as soon as possible:

    Description string
    Description of the log project.
    Name string
    . Field 'name' has been deprecated from provider version 1.212.0. New field 'project_name' instead.

    Deprecated: Field 'name' has been deprecated since provider version 1.212.0. New field 'project_name' instead.

    Policy string
    Log project policy, used to set a policy for a project.
    ProjectName string
    The name of the log project. It is the only in one Alicloud account.
    ResourceGroupId string
    The ID of the resource group.
    Tags map[string]interface{}

    Tag.

    The following arguments will be discarded. Please use new fields as soon as possible:

    description String
    Description of the log project.
    name String
    . Field 'name' has been deprecated from provider version 1.212.0. New field 'project_name' instead.

    Deprecated: Field 'name' has been deprecated since provider version 1.212.0. New field 'project_name' instead.

    policy String
    Log project policy, used to set a policy for a project.
    projectName String
    The name of the log project. It is the only in one Alicloud account.
    resourceGroupId String
    The ID of the resource group.
    tags Map<String,Object>

    Tag.

    The following arguments will be discarded. Please use new fields as soon as possible:

    description string
    Description of the log project.
    name string
    . Field 'name' has been deprecated from provider version 1.212.0. New field 'project_name' instead.

    Deprecated: Field 'name' has been deprecated since provider version 1.212.0. New field 'project_name' instead.

    policy string
    Log project policy, used to set a policy for a project.
    projectName string
    The name of the log project. It is the only in one Alicloud account.
    resourceGroupId string
    The ID of the resource group.
    tags {[key: string]: any}

    Tag.

    The following arguments will be discarded. Please use new fields as soon as possible:

    description str
    Description of the log project.
    name str
    . Field 'name' has been deprecated from provider version 1.212.0. New field 'project_name' instead.

    Deprecated: Field 'name' has been deprecated since provider version 1.212.0. New field 'project_name' instead.

    policy str
    Log project policy, used to set a policy for a project.
    project_name str
    The name of the log project. It is the only in one Alicloud account.
    resource_group_id str
    The ID of the resource group.
    tags Mapping[str, Any]

    Tag.

    The following arguments will be discarded. Please use new fields as soon as possible:

    description String
    Description of the log project.
    name String
    . Field 'name' has been deprecated from provider version 1.212.0. New field 'project_name' instead.

    Deprecated: Field 'name' has been deprecated since provider version 1.212.0. New field 'project_name' instead.

    policy String
    Log project policy, used to set a policy for a project.
    projectName String
    The name of the log project. It is the only in one Alicloud account.
    resourceGroupId String
    The ID of the resource group.
    tags Map<Any>

    Tag.

    The following arguments will be discarded. Please use new fields as soon as possible:

    Outputs

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

    CreateTime string
    CreateTime.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource.
    CreateTime string
    CreateTime.
    Id string
    The provider-assigned unique ID for this managed resource.
    Status string
    The status of the resource.
    createTime String
    CreateTime.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource.
    createTime string
    CreateTime.
    id string
    The provider-assigned unique ID for this managed resource.
    status string
    The status of the resource.
    create_time str
    CreateTime.
    id str
    The provider-assigned unique ID for this managed resource.
    status str
    The status of the resource.
    createTime String
    CreateTime.
    id String
    The provider-assigned unique ID for this managed resource.
    status String
    The status of the resource.

    Look up Existing Project Resource

    Get an existing Project 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?: ProjectState, opts?: CustomResourceOptions): Project
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            policy: Optional[str] = None,
            project_name: Optional[str] = None,
            resource_group_id: Optional[str] = None,
            status: Optional[str] = None,
            tags: Optional[Mapping[str, Any]] = None) -> Project
    func GetProject(ctx *Context, name string, id IDInput, state *ProjectState, opts ...ResourceOption) (*Project, error)
    public static Project Get(string name, Input<string> id, ProjectState? state, CustomResourceOptions? opts = null)
    public static Project get(String name, Output<String> id, ProjectState 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:
    CreateTime string
    CreateTime.
    Description string
    Description of the log project.
    Name string
    . Field 'name' has been deprecated from provider version 1.212.0. New field 'project_name' instead.

    Deprecated: Field 'name' has been deprecated since provider version 1.212.0. New field 'project_name' instead.

    Policy string
    Log project policy, used to set a policy for a project.
    ProjectName string
    The name of the log project. It is the only in one Alicloud account.
    ResourceGroupId string
    The ID of the resource group.
    Status string
    The status of the resource.
    Tags Dictionary<string, object>

    Tag.

    The following arguments will be discarded. Please use new fields as soon as possible:

    CreateTime string
    CreateTime.
    Description string
    Description of the log project.
    Name string
    . Field 'name' has been deprecated from provider version 1.212.0. New field 'project_name' instead.

    Deprecated: Field 'name' has been deprecated since provider version 1.212.0. New field 'project_name' instead.

    Policy string
    Log project policy, used to set a policy for a project.
    ProjectName string
    The name of the log project. It is the only in one Alicloud account.
    ResourceGroupId string
    The ID of the resource group.
    Status string
    The status of the resource.
    Tags map[string]interface{}

    Tag.

    The following arguments will be discarded. Please use new fields as soon as possible:

    createTime String
    CreateTime.
    description String
    Description of the log project.
    name String
    . Field 'name' has been deprecated from provider version 1.212.0. New field 'project_name' instead.

    Deprecated: Field 'name' has been deprecated since provider version 1.212.0. New field 'project_name' instead.

    policy String
    Log project policy, used to set a policy for a project.
    projectName String
    The name of the log project. It is the only in one Alicloud account.
    resourceGroupId String
    The ID of the resource group.
    status String
    The status of the resource.
    tags Map<String,Object>

    Tag.

    The following arguments will be discarded. Please use new fields as soon as possible:

    createTime string
    CreateTime.
    description string
    Description of the log project.
    name string
    . Field 'name' has been deprecated from provider version 1.212.0. New field 'project_name' instead.

    Deprecated: Field 'name' has been deprecated since provider version 1.212.0. New field 'project_name' instead.

    policy string
    Log project policy, used to set a policy for a project.
    projectName string
    The name of the log project. It is the only in one Alicloud account.
    resourceGroupId string
    The ID of the resource group.
    status string
    The status of the resource.
    tags {[key: string]: any}

    Tag.

    The following arguments will be discarded. Please use new fields as soon as possible:

    create_time str
    CreateTime.
    description str
    Description of the log project.
    name str
    . Field 'name' has been deprecated from provider version 1.212.0. New field 'project_name' instead.

    Deprecated: Field 'name' has been deprecated since provider version 1.212.0. New field 'project_name' instead.

    policy str
    Log project policy, used to set a policy for a project.
    project_name str
    The name of the log project. It is the only in one Alicloud account.
    resource_group_id str
    The ID of the resource group.
    status str
    The status of the resource.
    tags Mapping[str, Any]

    Tag.

    The following arguments will be discarded. Please use new fields as soon as possible:

    createTime String
    CreateTime.
    description String
    Description of the log project.
    name String
    . Field 'name' has been deprecated from provider version 1.212.0. New field 'project_name' instead.

    Deprecated: Field 'name' has been deprecated since provider version 1.212.0. New field 'project_name' instead.

    policy String
    Log project policy, used to set a policy for a project.
    projectName String
    The name of the log project. It is the only in one Alicloud account.
    resourceGroupId String
    The ID of the resource group.
    status String
    The status of the resource.
    tags Map<Any>

    Tag.

    The following arguments will be discarded. Please use new fields as soon as possible:

    Import

    SLS Project can be imported using the id, e.g.

    $ pulumi import alicloud:log/project:Project 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.52.1 published on Thursday, Apr 4, 2024 by Pulumi