1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. resourcemanager
  5. ServiceLinkedRole
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.resourcemanager.ServiceLinkedRole

Explore with Pulumi AI

Provides a Resource Manager Service Linked Role.

For information about Resource Manager Service Linked Role and how to use it, see What is Service Linked Role..

NOTE: Available since v1.157.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const _default = new alicloud.resourcemanager.ServiceLinkedRole("default", {serviceName: "ops.elasticsearch.aliyuncs.com"});
Copy
import pulumi
import pulumi_alicloud as alicloud

default = alicloud.resourcemanager.ServiceLinkedRole("default", service_name="ops.elasticsearch.aliyuncs.com")
Copy
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/resourcemanager"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := resourcemanager.NewServiceLinkedRole(ctx, "default", &resourcemanager.ServiceLinkedRoleArgs{
			ServiceName: pulumi.String("ops.elasticsearch.aliyuncs.com"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var @default = new AliCloud.ResourceManager.ServiceLinkedRole("default", new()
    {
        ServiceName = "ops.elasticsearch.aliyuncs.com",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.resourcemanager.ServiceLinkedRole;
import com.pulumi.alicloud.resourcemanager.ServiceLinkedRoleArgs;
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 ServiceLinkedRole("default", ServiceLinkedRoleArgs.builder()
            .serviceName("ops.elasticsearch.aliyuncs.com")
            .build());

    }
}
Copy
resources:
  default:
    type: alicloud:resourcemanager:ServiceLinkedRole
    properties:
      serviceName: ops.elasticsearch.aliyuncs.com
Copy

Create ServiceLinkedRole Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ServiceLinkedRole(name: string, args: ServiceLinkedRoleArgs, opts?: CustomResourceOptions);
@overload
def ServiceLinkedRole(resource_name: str,
                      args: ServiceLinkedRoleArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def ServiceLinkedRole(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      service_name: Optional[str] = None,
                      custom_suffix: Optional[str] = None,
                      description: Optional[str] = None)
func NewServiceLinkedRole(ctx *Context, name string, args ServiceLinkedRoleArgs, opts ...ResourceOption) (*ServiceLinkedRole, error)
public ServiceLinkedRole(string name, ServiceLinkedRoleArgs args, CustomResourceOptions? opts = null)
public ServiceLinkedRole(String name, ServiceLinkedRoleArgs args)
public ServiceLinkedRole(String name, ServiceLinkedRoleArgs args, CustomResourceOptions options)
type: alicloud:resourcemanager:ServiceLinkedRole
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ServiceLinkedRoleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ServiceLinkedRoleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ServiceLinkedRoleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ServiceLinkedRoleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ServiceLinkedRoleArgs
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 exampleserviceLinkedRoleResourceResourceFromResourcemanagerserviceLinkedRole = new AliCloud.ResourceManager.ServiceLinkedRole("exampleserviceLinkedRoleResourceResourceFromResourcemanagerserviceLinkedRole", new()
{
    ServiceName = "string",
    CustomSuffix = "string",
    Description = "string",
});
Copy
example, err := resourcemanager.NewServiceLinkedRole(ctx, "exampleserviceLinkedRoleResourceResourceFromResourcemanagerserviceLinkedRole", &resourcemanager.ServiceLinkedRoleArgs{
	ServiceName:  pulumi.String("string"),
	CustomSuffix: pulumi.String("string"),
	Description:  pulumi.String("string"),
})
Copy
var exampleserviceLinkedRoleResourceResourceFromResourcemanagerserviceLinkedRole = new ServiceLinkedRole("exampleserviceLinkedRoleResourceResourceFromResourcemanagerserviceLinkedRole", ServiceLinkedRoleArgs.builder()
    .serviceName("string")
    .customSuffix("string")
    .description("string")
    .build());
Copy
exampleservice_linked_role_resource_resource_from_resourcemanagerservice_linked_role = alicloud.resourcemanager.ServiceLinkedRole("exampleserviceLinkedRoleResourceResourceFromResourcemanagerserviceLinkedRole",
    service_name="string",
    custom_suffix="string",
    description="string")
Copy
const exampleserviceLinkedRoleResourceResourceFromResourcemanagerserviceLinkedRole = new alicloud.resourcemanager.ServiceLinkedRole("exampleserviceLinkedRoleResourceResourceFromResourcemanagerserviceLinkedRole", {
    serviceName: "string",
    customSuffix: "string",
    description: "string",
});
Copy
type: alicloud:resourcemanager:ServiceLinkedRole
properties:
    customSuffix: string
    description: string
    serviceName: string
Copy

ServiceLinkedRole Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The ServiceLinkedRole resource accepts the following input properties:

ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The service name. For more information about the service name, see Cloud services that support service linked roles
CustomSuffix Changes to this property will trigger replacement. string
The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
Description Changes to this property will trigger replacement. string
The description of the service linked role. This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The service name. For more information about the service name, see Cloud services that support service linked roles
CustomSuffix Changes to this property will trigger replacement. string
The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
Description Changes to this property will trigger replacement. string
The description of the service linked role. This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The service name. For more information about the service name, see Cloud services that support service linked roles
customSuffix Changes to this property will trigger replacement. String
The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
description Changes to this property will trigger replacement. String
The description of the service linked role. This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
serviceName
This property is required.
Changes to this property will trigger replacement.
string
The service name. For more information about the service name, see Cloud services that support service linked roles
customSuffix Changes to this property will trigger replacement. string
The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
description Changes to this property will trigger replacement. string
The description of the service linked role. This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
service_name
This property is required.
Changes to this property will trigger replacement.
str
The service name. For more information about the service name, see Cloud services that support service linked roles
custom_suffix Changes to this property will trigger replacement. str
The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
description Changes to this property will trigger replacement. str
The description of the service linked role. This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The service name. For more information about the service name, see Cloud services that support service linked roles
customSuffix Changes to this property will trigger replacement. String
The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
description Changes to this property will trigger replacement. String
The description of the service linked role. This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.

Outputs

All input properties are implicitly available as output properties. Additionally, the ServiceLinkedRole resource produces the following output properties:

Arn string
The Alibaba Cloud Resource Name (ARN) of the role.
Id string
The provider-assigned unique ID for this managed resource.
RoleId string
The ID of the role.
RoleName string
The name of the role.
Arn string
The Alibaba Cloud Resource Name (ARN) of the role.
Id string
The provider-assigned unique ID for this managed resource.
RoleId string
The ID of the role.
RoleName string
The name of the role.
arn String
The Alibaba Cloud Resource Name (ARN) of the role.
id String
The provider-assigned unique ID for this managed resource.
roleId String
The ID of the role.
roleName String
The name of the role.
arn string
The Alibaba Cloud Resource Name (ARN) of the role.
id string
The provider-assigned unique ID for this managed resource.
roleId string
The ID of the role.
roleName string
The name of the role.
arn str
The Alibaba Cloud Resource Name (ARN) of the role.
id str
The provider-assigned unique ID for this managed resource.
role_id str
The ID of the role.
role_name str
The name of the role.
arn String
The Alibaba Cloud Resource Name (ARN) of the role.
id String
The provider-assigned unique ID for this managed resource.
roleId String
The ID of the role.
roleName String
The name of the role.

Look up Existing ServiceLinkedRole Resource

Get an existing ServiceLinkedRole 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?: ServiceLinkedRoleState, opts?: CustomResourceOptions): ServiceLinkedRole
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        custom_suffix: Optional[str] = None,
        description: Optional[str] = None,
        role_id: Optional[str] = None,
        role_name: Optional[str] = None,
        service_name: Optional[str] = None) -> ServiceLinkedRole
func GetServiceLinkedRole(ctx *Context, name string, id IDInput, state *ServiceLinkedRoleState, opts ...ResourceOption) (*ServiceLinkedRole, error)
public static ServiceLinkedRole Get(string name, Input<string> id, ServiceLinkedRoleState? state, CustomResourceOptions? opts = null)
public static ServiceLinkedRole get(String name, Output<String> id, ServiceLinkedRoleState state, CustomResourceOptions options)
resources:  _:    type: alicloud:resourcemanager:ServiceLinkedRole    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Arn string
The Alibaba Cloud Resource Name (ARN) of the role.
CustomSuffix Changes to this property will trigger replacement. string
The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
Description Changes to this property will trigger replacement. string
The description of the service linked role. This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
RoleId string
The ID of the role.
RoleName string
The name of the role.
ServiceName Changes to this property will trigger replacement. string
The service name. For more information about the service name, see Cloud services that support service linked roles
Arn string
The Alibaba Cloud Resource Name (ARN) of the role.
CustomSuffix Changes to this property will trigger replacement. string
The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
Description Changes to this property will trigger replacement. string
The description of the service linked role. This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
RoleId string
The ID of the role.
RoleName string
The name of the role.
ServiceName Changes to this property will trigger replacement. string
The service name. For more information about the service name, see Cloud services that support service linked roles
arn String
The Alibaba Cloud Resource Name (ARN) of the role.
customSuffix Changes to this property will trigger replacement. String
The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
description Changes to this property will trigger replacement. String
The description of the service linked role. This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
roleId String
The ID of the role.
roleName String
The name of the role.
serviceName Changes to this property will trigger replacement. String
The service name. For more information about the service name, see Cloud services that support service linked roles
arn string
The Alibaba Cloud Resource Name (ARN) of the role.
customSuffix Changes to this property will trigger replacement. string
The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
description Changes to this property will trigger replacement. string
The description of the service linked role. This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
roleId string
The ID of the role.
roleName string
The name of the role.
serviceName Changes to this property will trigger replacement. string
The service name. For more information about the service name, see Cloud services that support service linked roles
arn str
The Alibaba Cloud Resource Name (ARN) of the role.
custom_suffix Changes to this property will trigger replacement. str
The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
description Changes to this property will trigger replacement. str
The description of the service linked role. This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
role_id str
The ID of the role.
role_name str
The name of the role.
service_name Changes to this property will trigger replacement. str
The service name. For more information about the service name, see Cloud services that support service linked roles
arn String
The Alibaba Cloud Resource Name (ARN) of the role.
customSuffix Changes to this property will trigger replacement. String
The suffix of the role name. Only a few service linked roles support custom suffixes. The role name (including its suffix) must be 1 to 64 characters in length and can contain letters, digits, periods (.), and hyphens (-). For example, if the suffix is Example, the role name is ServiceLinkedRoleName_Example.
description Changes to this property will trigger replacement. String
The description of the service linked role. This parameter must be specified for only the service linked roles that support custom suffixes. Otherwise, the preset value is used and cannot be modified. The description must be 1 to 1,024 characters in length.
roleId String
The ID of the role.
roleName String
The name of the role.
serviceName Changes to this property will trigger replacement. String
The service name. For more information about the service name, see Cloud services that support service linked roles

Import

Resource Manager Service Linked Role can be imported using the id, e.g.

$ pulumi import alicloud:resourcemanager/serviceLinkedRole:ServiceLinkedRole default <service_name>:<role_name>
Copy

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.