alicloud.log.Project
Explore with Pulumi AI
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.index.Integer("default", {
max: 99999,
min: 10000,
});
const example = new alicloud.log.Project("example", {
projectName: `terraform-example-${_default.result}`,
description: "terraform-example",
tags: {
Created: "TF",
For: "example",
},
});
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random
default = random.index.Integer("default",
max=99999,
min=10000)
example = alicloud.log.Project("example",
project_name=f"terraform-example-{default['result']}",
description="terraform-example",
tags={
"Created": "TF",
"For": "example",
})
package main
import (
"fmt"
"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.NewInteger(ctx, "default", &random.IntegerArgs{
Max: 99999,
Min: 10000,
})
if err != nil {
return err
}
_, err = log.NewProject(ctx, "example", &log.ProjectArgs{
ProjectName: pulumi.Sprintf("terraform-example-%v", _default.Result),
Description: pulumi.String("terraform-example"),
Tags: pulumi.StringMap{
"Created": pulumi.String("TF"),
"For": pulumi.String("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.Index.Integer("default", new()
{
Max = 99999,
Min = 10000,
});
var example = new AliCloud.Log.Project("example", new()
{
ProjectName = $"terraform-example-{@default.Result}",
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.integer;
import com.pulumi.random.IntegerArgs;
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 Integer("default", IntegerArgs.builder()
.max(99999)
.min(10000)
.build());
var example = new Project("example", ProjectArgs.builder()
.projectName(String.format("terraform-example-%s", default_.result()))
.description("terraform-example")
.tags(Map.ofEntries(
Map.entry("Created", "TF"),
Map.entry("For", "example")
))
.build());
}
}
resources:
default:
type: random:integer
properties:
max: 99999
min: 10000
example:
type: alicloud:log:Project
properties:
projectName: terraform-example-${default.result}
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.index.Integer("default", {
max: 99999,
min: 10000,
});
const examplePolicy = new alicloud.log.Project("example_policy", {
projectName: `terraform-example-${_default.result}`,
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.index.Integer("default",
max=99999,
min=10000)
example_policy = alicloud.log.Project("example_policy",
project_name=f"terraform-example-{default['result']}",
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 (
"fmt"
"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.NewInteger(ctx, "default", &random.IntegerArgs{
Max: 99999,
Min: 10000,
})
if err != nil {
return err
}
_, err = log.NewProject(ctx, "example_policy", &log.ProjectArgs{
ProjectName: pulumi.Sprintf("terraform-example-%v", _default.Result),
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.Index.Integer("default", new()
{
Max = 99999,
Min = 10000,
});
var examplePolicy = new AliCloud.Log.Project("example_policy", new()
{
ProjectName = $"terraform-example-{@default.Result}",
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.integer;
import com.pulumi.random.IntegerArgs;
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 Integer("default", IntegerArgs.builder()
.max(99999)
.min(10000)
.build());
var examplePolicy = new Project("examplePolicy", ProjectArgs.builder()
.projectName(String.format("terraform-example-%s", default_.result()))
.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:integer
properties:
max: 99999
min: 10000
examplePolicy:
type: alicloud:log:Project
name: example_policy
properties:
projectName: terraform-example-${default.result}
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, str]] = 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.
Constructor 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", "string" },
},
});
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.StringMap{
"string": pulumi.String("string"),
},
})
var exampleprojectResourceResourceFromLogproject = new Project("exampleprojectResourceResourceFromLogproject", ProjectArgs.builder()
.description("string")
.policy("string")
.projectName("string")
.resourceGroupId("string")
.tags(Map.of("string", "string"))
.build());
exampleproject_resource_resource_from_logproject = alicloud.log.Project("exampleprojectResourceResourceFromLogproject",
description="string",
policy="string",
project_name="string",
resource_group_id="string",
tags={
"string": "string",
})
const exampleprojectResourceResourceFromLogproject = new alicloud.log.Project("exampleprojectResourceResourceFromLogproject", {
description: "string",
policy: "string",
projectName: "string",
resourceGroupId: "string",
tags: {
string: "string",
},
});
type: alicloud:log:Project
properties:
description: string
policy: string
projectName: string
resourceGroupId: string
tags:
string: string
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.
- Name string
- . Field 'name' has been deprecated from provider version 1.223.0. New field 'project_name' instead.
- Policy string
- Log project policy, used to set a policy for a project.
- Project
Name string - The name of the log project. It is the only in one Alicloud account. The project name is globally unique in Alibaba Cloud and cannot be modified after it is created. The naming rules are as follows:
- The project name must be globally unique.
- The name can contain only lowercase letters, digits, and hyphens (-).
- It must start and end with a lowercase letter or number.
- The value contains 3 to 63 characters.
- Resource
Group stringId - The ID of the resource group.
- Dictionary<string, string>
Tag.
The following arguments will be discarded. Please use new fields as soon as possible:
- Description string
- Description.
- Name string
- . Field 'name' has been deprecated from provider version 1.223.0. New field 'project_name' instead.
- Policy string
- Log project policy, used to set a policy for a project.
- Project
Name string - The name of the log project. It is the only in one Alicloud account. The project name is globally unique in Alibaba Cloud and cannot be modified after it is created. The naming rules are as follows:
- The project name must be globally unique.
- The name can contain only lowercase letters, digits, and hyphens (-).
- It must start and end with a lowercase letter or number.
- The value contains 3 to 63 characters.
- Resource
Group stringId - The ID of the resource group.
- map[string]string
Tag.
The following arguments will be discarded. Please use new fields as soon as possible:
- description String
- Description.
- name String
- . Field 'name' has been deprecated from provider version 1.223.0. New field 'project_name' instead.
- policy String
- Log project policy, used to set a policy for a project.
- project
Name String - The name of the log project. It is the only in one Alicloud account. The project name is globally unique in Alibaba Cloud and cannot be modified after it is created. The naming rules are as follows:
- The project name must be globally unique.
- The name can contain only lowercase letters, digits, and hyphens (-).
- It must start and end with a lowercase letter or number.
- The value contains 3 to 63 characters.
- resource
Group StringId - The ID of the resource group.
- Map<String,String>
Tag.
The following arguments will be discarded. Please use new fields as soon as possible:
- description string
- Description.
- name string
- . Field 'name' has been deprecated from provider version 1.223.0. New field 'project_name' instead.
- policy string
- Log project policy, used to set a policy for a project.
- project
Name string - The name of the log project. It is the only in one Alicloud account. The project name is globally unique in Alibaba Cloud and cannot be modified after it is created. The naming rules are as follows:
- The project name must be globally unique.
- The name can contain only lowercase letters, digits, and hyphens (-).
- It must start and end with a lowercase letter or number.
- The value contains 3 to 63 characters.
- resource
Group stringId - The ID of the resource group.
- {[key: string]: string}
Tag.
The following arguments will be discarded. Please use new fields as soon as possible:
- description str
- Description.
- name str
- . Field 'name' has been deprecated from provider version 1.223.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. The project name is globally unique in Alibaba Cloud and cannot be modified after it is created. The naming rules are as follows:
- The project name must be globally unique.
- The name can contain only lowercase letters, digits, and hyphens (-).
- It must start and end with a lowercase letter or number.
- The value contains 3 to 63 characters.
- resource_
group_ strid - The ID of the resource group.
- Mapping[str, str]
Tag.
The following arguments will be discarded. Please use new fields as soon as possible:
- description String
- Description.
- name String
- . Field 'name' has been deprecated from provider version 1.223.0. New field 'project_name' instead.
- policy String
- Log project policy, used to set a policy for a project.
- project
Name String - The name of the log project. It is the only in one Alicloud account. The project name is globally unique in Alibaba Cloud and cannot be modified after it is created. The naming rules are as follows:
- The project name must be globally unique.
- The name can contain only lowercase letters, digits, and hyphens (-).
- It must start and end with a lowercase letter or number.
- The value contains 3 to 63 characters.
- resource
Group StringId - The ID of the resource group.
- Map<String>
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:
- Create
Time string - CreateTime.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The status of the resource.
- Create
Time string - CreateTime.
- Id string
- The provider-assigned unique ID for this managed resource.
- Status string
- The status of the resource.
- create
Time String - CreateTime.
- id String
- The provider-assigned unique ID for this managed resource.
- status String
- The status of the resource.
- create
Time 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.
- create
Time 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, str]] = 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.
- Create
Time string - CreateTime.
- Description string
- Description.
- Name string
- . Field 'name' has been deprecated from provider version 1.223.0. New field 'project_name' instead.
- Policy string
- Log project policy, used to set a policy for a project.
- Project
Name string - The name of the log project. It is the only in one Alicloud account. The project name is globally unique in Alibaba Cloud and cannot be modified after it is created. The naming rules are as follows:
- The project name must be globally unique.
- The name can contain only lowercase letters, digits, and hyphens (-).
- It must start and end with a lowercase letter or number.
- The value contains 3 to 63 characters.
- Resource
Group stringId - The ID of the resource group.
- Status string
- The status of the resource.
- Dictionary<string, string>
Tag.
The following arguments will be discarded. Please use new fields as soon as possible:
- Create
Time string - CreateTime.
- Description string
- Description.
- Name string
- . Field 'name' has been deprecated from provider version 1.223.0. New field 'project_name' instead.
- Policy string
- Log project policy, used to set a policy for a project.
- Project
Name string - The name of the log project. It is the only in one Alicloud account. The project name is globally unique in Alibaba Cloud and cannot be modified after it is created. The naming rules are as follows:
- The project name must be globally unique.
- The name can contain only lowercase letters, digits, and hyphens (-).
- It must start and end with a lowercase letter or number.
- The value contains 3 to 63 characters.
- Resource
Group stringId - The ID of the resource group.
- Status string
- The status of the resource.
- map[string]string
Tag.
The following arguments will be discarded. Please use new fields as soon as possible:
- create
Time String - CreateTime.
- description String
- Description.
- name String
- . Field 'name' has been deprecated from provider version 1.223.0. New field 'project_name' instead.
- policy String
- Log project policy, used to set a policy for a project.
- project
Name String - The name of the log project. It is the only in one Alicloud account. The project name is globally unique in Alibaba Cloud and cannot be modified after it is created. The naming rules are as follows:
- The project name must be globally unique.
- The name can contain only lowercase letters, digits, and hyphens (-).
- It must start and end with a lowercase letter or number.
- The value contains 3 to 63 characters.
- resource
Group StringId - The ID of the resource group.
- status String
- The status of the resource.
- Map<String,String>
Tag.
The following arguments will be discarded. Please use new fields as soon as possible:
- create
Time string - CreateTime.
- description string
- Description.
- name string
- . Field 'name' has been deprecated from provider version 1.223.0. New field 'project_name' instead.
- policy string
- Log project policy, used to set a policy for a project.
- project
Name string - The name of the log project. It is the only in one Alicloud account. The project name is globally unique in Alibaba Cloud and cannot be modified after it is created. The naming rules are as follows:
- The project name must be globally unique.
- The name can contain only lowercase letters, digits, and hyphens (-).
- It must start and end with a lowercase letter or number.
- The value contains 3 to 63 characters.
- resource
Group stringId - The ID of the resource group.
- status string
- The status of the resource.
- {[key: string]: string}
Tag.
The following arguments will be discarded. Please use new fields as soon as possible:
- create_
time str - CreateTime.
- description str
- Description.
- name str
- . Field 'name' has been deprecated from provider version 1.223.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. The project name is globally unique in Alibaba Cloud and cannot be modified after it is created. The naming rules are as follows:
- The project name must be globally unique.
- The name can contain only lowercase letters, digits, and hyphens (-).
- It must start and end with a lowercase letter or number.
- The value contains 3 to 63 characters.
- resource_
group_ strid - The ID of the resource group.
- status str
- The status of the resource.
- Mapping[str, str]
Tag.
The following arguments will be discarded. Please use new fields as soon as possible:
- create
Time String - CreateTime.
- description String
- Description.
- name String
- . Field 'name' has been deprecated from provider version 1.223.0. New field 'project_name' instead.
- policy String
- Log project policy, used to set a policy for a project.
- project
Name String - The name of the log project. It is the only in one Alicloud account. The project name is globally unique in Alibaba Cloud and cannot be modified after it is created. The naming rules are as follows:
- The project name must be globally unique.
- The name can contain only lowercase letters, digits, and hyphens (-).
- It must start and end with a lowercase letter or number.
- The value contains 3 to 63 characters.
- resource
Group StringId - The ID of the resource group.
- status String
- The status of the resource.
- Map<String>
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.