com.pulumi.alicloud.imm.Project Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of alicloud Show documentation
Show all versions of alicloud Show documentation
A Pulumi package for creating and managing AliCloud resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.alicloud.imm;
import com.pulumi.alicloud.Utilities;
import com.pulumi.alicloud.imm.ProjectArgs;
import com.pulumi.alicloud.imm.inputs.ProjectState;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.String;
import javax.annotation.Nullable;
/**
* Provides a Intelligent Media Management Project resource.
*
* For information about Intelligent Media Management Project and how to use it, see [What is Project](https://www.alibabacloud.com/help/en/network-intelligence-service/latest/user-overview).
*
* > **NOTE:** Available since v1.134.0.
*
* ## Example Usage
*
* Basic Usage
*
* <!--Start PulumiCodeChooser -->
*
* {@code
* 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());
*
* }
* }
* }
*
* <!--End PulumiCodeChooser -->
*
* ## Import
*
* Intelligent Media Management Project can be imported using the id, e.g.
*
* ```sh
* $ pulumi import alicloud:imm/project:Project example <project>
* ```
*
*/
@ResourceType(type="alicloud:imm/project:Project")
public class Project extends com.pulumi.resources.CustomResource {
/**
* The name of Project.
*
*/
@Export(name="project", refs={String.class}, tree="[0]")
private Output project;
/**
* @return The name of Project.
*
*/
public Output project() {
return this.project;
}
/**
* 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`.
*
*/
@Export(name="serviceRole", refs={String.class}, tree="[0]")
private Output serviceRole;
/**
* @return 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`.
*
*/
public Output serviceRole() {
return this.serviceRole;
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public Project(java.lang.String name) {
this(name, ProjectArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public Project(java.lang.String name, ProjectArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public Project(java.lang.String name, ProjectArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:imm/project:Project", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private Project(java.lang.String name, Output id, @Nullable ProjectState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("alicloud:imm/project:Project", name, state, makeResourceOptions(options, id), false);
}
private static ProjectArgs makeArgs(ProjectArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? ProjectArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param state
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static Project get(java.lang.String name, Output id, @Nullable ProjectState state, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new Project(name, id, state, options);
}
}