Role
Provides a RAM Role resource.
NOTE: When you want to destroy this resource forcefully(means remove all the relationships associated with it automatically and then destroy it) without set
force
withtrue
at beginning, you need addforce = true
to configuration file and runpulumi preview
, then you can delete resource forcefully. NOTE: Available since v1.0.0+.
Example Usage
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 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 role = new Role("role", RoleArgs.builder()
.description("this is a role test.")
.document("""
{
"Statement": [
{
"Action": "sts:AssumeRole",
"Effect": "Allow",
"Principal": {
"Service": [
"apigateway.aliyuncs.com",
"ecs.aliyuncs.com"
]
}
}
],
"Version": "1"
}
""")
.build());
}
}
Import
RAM role can be imported using the id or name, e.g.
$ pulumi import alicloud:ram/role:Role example my-role
Properties
(It has been deprecated since version 1.49.0, and use field 'document' to replace.) List of ram users who can assume the RAM role. The format of each item in this list is acs:ram::${account_id}:root
or acs:ram::${account_id}:user/${user_name}
, such as acs:ram::1234567890000:root
and acs:ram::1234567890001:user/Mary
. The ${user_name}
is the name of a RAM user which must exists in the Alicloud account indicated by the ${account_id}
.
(It has been deprecated since version 1.49.0, and use field 'document' to replace.) List of services which can assume the RAM role. The format of each item in this list is ${service}.aliyuncs.com
or ${account_id}@${service}.aliyuncs.com
, such as ecs.aliyuncs.com
and 1234567890000@ots.aliyuncs.com
. The ${service}
can be ecs
, log
, apigateway
and so on, the ${account_id}
refers to someone's Alicloud account id.