1. Packages
  2. Alicloud Provider
  3. API Docs
  4. imm
  5. Project
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.imm.Project

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

    Provides a Intelligent Media Management Project resource.

    For information about Intelligent Media Management Project and how to use it, see What is Project.

    NOTE: Available since v1.134.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") || "tfexample";
    const role = new alicloud.ram.Role("role", {
        name: name,
        document: `  {
        "Statement": [
          {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
              "Service": [
                "imm.aliyuncs.com"
              ]
            }
          }
        ],
        "Version": "1"
      }
    `,
        description: "this is a role test.",
        force: true,
    });
    const example = new alicloud.imm.Project("example", {
        project: name,
        serviceRole: role.name,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "tfexample"
    role = alicloud.ram.Role("role",
        name=name,
        document="""  {
        "Statement": [
          {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
              "Service": [
                "imm.aliyuncs.com"
              ]
            }
          }
        ],
        "Version": "1"
      }
    """,
        description="this is a role test.",
        force=True)
    example = alicloud.imm.Project("example",
        project=name,
        service_role=role.name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/imm"
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ram"
    	"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 := "tfexample"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		role, err := ram.NewRole(ctx, "role", &ram.RoleArgs{
    			Name: pulumi.String(name),
    			Document: pulumi.String(`  {
        "Statement": [
          {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
              "Service": [
                "imm.aliyuncs.com"
              ]
            }
          }
        ],
        "Version": "1"
      }
    `),
    			Description: pulumi.String("this is a role test."),
    			Force:       pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = imm.NewProject(ctx, "example", &imm.ProjectArgs{
    			Project:     pulumi.String(name),
    			ServiceRole: role.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") ?? "tfexample";
        var role = new AliCloud.Ram.Role("role", new()
        {
            Name = name,
            Document = @"  {
        ""Statement"": [
          {
            ""Action"": ""sts:AssumeRole"",
            ""Effect"": ""Allow"",
            ""Principal"": {
              ""Service"": [
                ""imm.aliyuncs.com""
              ]
            }
          }
        ],
        ""Version"": ""1""
      }
    ",
            Description = "this is a role test.",
            Force = true,
        });
    
        var example = new AliCloud.Imm.Project("example", new()
        {
            ProjectName = name,
            ServiceRole = role.Name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.ram.Role;
    import com.pulumi.alicloud.ram.RoleArgs;
    import com.pulumi.alicloud.imm.Project;
    import com.pulumi.alicloud.imm.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) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("tfexample");
            var role = new Role("role", RoleArgs.builder()
                .name(name)
                .document("""
      {
        "Statement": [
          {
            "Action": "sts:AssumeRole",
            "Effect": "Allow",
            "Principal": {
              "Service": [
                "imm.aliyuncs.com"
              ]
            }
          }
        ],
        "Version": "1"
      }
                """)
                .description("this is a role test.")
                .force(true)
                .build());
    
            var example = new Project("example", ProjectArgs.builder()
                .project(name)
                .serviceRole(role.name())
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: tfexample
    resources:
      role:
        type: alicloud:ram:Role
        properties:
          name: ${name}
          document: |2
              {
                "Statement": [
                  {
                    "Action": "sts:AssumeRole",
                    "Effect": "Allow",
                    "Principal": {
                      "Service": [
                        "imm.aliyuncs.com"
                      ]
                    }
                  }
                ],
                "Version": "1"
              }
          description: this is a role test.
          force: true
      example:
        type: alicloud:imm:Project
        properties:
          project: ${name}
          serviceRole: ${role.name}
    

    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: ProjectArgs,
                opts: Optional[ResourceOptions] = None)
    
    @overload
    def Project(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                project: Optional[str] = None,
                service_role: Optional[str] = None)
    func NewProject(ctx *Context, name string, args ProjectArgs, opts ...ResourceOption) (*Project, error)
    public Project(string name, ProjectArgs args, CustomResourceOptions? opts = null)
    public Project(String name, ProjectArgs args)
    public Project(String name, ProjectArgs args, CustomResourceOptions options)
    
    type: alicloud:imm: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 exampleprojectResourceResourceFromImmproject = new AliCloud.Imm.Project("exampleprojectResourceResourceFromImmproject", new()
    {
        ProjectName = "string",
        ServiceRole = "string",
    });
    
    example, err := imm.NewProject(ctx, "exampleprojectResourceResourceFromImmproject", &imm.ProjectArgs{
    	Project:     pulumi.String("string"),
    	ServiceRole: pulumi.String("string"),
    })
    
    var exampleprojectResourceResourceFromImmproject = new Project("exampleprojectResourceResourceFromImmproject", ProjectArgs.builder()
        .project("string")
        .serviceRole("string")
        .build());
    
    exampleproject_resource_resource_from_immproject = alicloud.imm.Project("exampleprojectResourceResourceFromImmproject",
        project="string",
        service_role="string")
    
    const exampleprojectResourceResourceFromImmproject = new alicloud.imm.Project("exampleprojectResourceResourceFromImmproject", {
        project: "string",
        serviceRole: "string",
    });
    
    type: alicloud:imm:Project
    properties:
        project: string
        serviceRole: 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:

    ProjectName string
    The name of Project.
    ServiceRole string
    The service role authorized to the Intelligent Media Management service to access other cloud resources. Default value: AliyunIMMDefaultRole. You can also create authorization roles through the alicloud.ram.Role.
    Project string
    The name of Project.
    ServiceRole string
    The service role authorized to the Intelligent Media Management service to access other cloud resources. Default value: AliyunIMMDefaultRole. You can also create authorization roles through the alicloud.ram.Role.
    project String
    The name of Project.
    serviceRole String
    The service role authorized to the Intelligent Media Management service to access other cloud resources. Default value: AliyunIMMDefaultRole. You can also create authorization roles through the alicloud.ram.Role.
    project string
    The name of Project.
    serviceRole string
    The service role authorized to the Intelligent Media Management service to access other cloud resources. Default value: AliyunIMMDefaultRole. You can also create authorization roles through the alicloud.ram.Role.
    project str
    The name of Project.
    service_role str
    The service role authorized to the Intelligent Media Management service to access other cloud resources. Default value: AliyunIMMDefaultRole. You can also create authorization roles through the alicloud.ram.Role.
    project String
    The name of Project.
    serviceRole String
    The service role authorized to the Intelligent Media Management service to access other cloud resources. Default value: AliyunIMMDefaultRole. You can also create authorization roles through the alicloud.ram.Role.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Project 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 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,
            project: Optional[str] = None,
            service_role: Optional[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.
    The following state arguments are supported:
    ProjectName string
    The name of Project.
    ServiceRole string
    The service role authorized to the Intelligent Media Management service to access other cloud resources. Default value: AliyunIMMDefaultRole. You can also create authorization roles through the alicloud.ram.Role.
    Project string
    The name of Project.
    ServiceRole string
    The service role authorized to the Intelligent Media Management service to access other cloud resources. Default value: AliyunIMMDefaultRole. You can also create authorization roles through the alicloud.ram.Role.
    project String
    The name of Project.
    serviceRole String
    The service role authorized to the Intelligent Media Management service to access other cloud resources. Default value: AliyunIMMDefaultRole. You can also create authorization roles through the alicloud.ram.Role.
    project string
    The name of Project.
    serviceRole string
    The service role authorized to the Intelligent Media Management service to access other cloud resources. Default value: AliyunIMMDefaultRole. You can also create authorization roles through the alicloud.ram.Role.
    project str
    The name of Project.
    service_role str
    The service role authorized to the Intelligent Media Management service to access other cloud resources. Default value: AliyunIMMDefaultRole. You can also create authorization roles through the alicloud.ram.Role.
    project String
    The name of Project.
    serviceRole String
    The service role authorized to the Intelligent Media Management service to access other cloud resources. Default value: AliyunIMMDefaultRole. You can also create authorization roles through the alicloud.ram.Role.

    Import

    Intelligent Media Management Project can be imported using the id, e.g.

    $ pulumi import alicloud:imm/project:Project example <project>
    

    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.62.1 published on Monday, Sep 16, 2024 by Pulumi