Project

class Project : KotlinCustomResource

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",
})
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 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 {
_default, 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
})
}
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"
}
""")
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 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 {
_default, 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
})
}
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.

Import

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

$ pulumi import alicloud:log/project:Project example <id>

//////

Properties

Link copied to clipboard
val createTime: Output<String>

CreateTime.

Link copied to clipboard
val description: Output<String>?

Description.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

. Field 'name' has been deprecated from provider version 1.223.0. New field 'project_name' instead.

Link copied to clipboard
val policy: Output<String>?

Log project policy, used to set a policy for a project.

Link copied to clipboard
val projectName: Output<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:

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resourceGroupId: Output<String>

The ID of the resource group.

Link copied to clipboard
val status: Output<String>

The status of the resource.

Link copied to clipboard
val tags: Output<Map<String, String>>?

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

Link copied to clipboard
val urn: Output<String>