1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. databasefilesystem
  5. ServiceLinkedRole
Alibaba Cloud v3.75.0 published on Friday, Mar 7, 2025 by Pulumi

alicloud.databasefilesystem.ServiceLinkedRole

Explore with Pulumi AI

Using this data source can create Dbfs service-linked roles(SLR). Dbfs may need to access another Alibaba Cloud service to implement a specific feature. In this case, Dbfs must assume a specific service-linked role, which is a Resource Access Management (RAM) role, to obtain permissions to access another Alibaba Cloud service.

For information about Dbfs service-linked roles(SLR) and how to use it, see What is service-linked roles.

NOTE: Available since v1.157.0.

Example Usage

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

const serviceLinkedRole = new alicloud.databasefilesystem.ServiceLinkedRole("service_linked_role", {productName: "AliyunServiceRoleForDbfs"});
Copy
import pulumi
import pulumi_alicloud as alicloud

service_linked_role = alicloud.databasefilesystem.ServiceLinkedRole("service_linked_role", product_name="AliyunServiceRoleForDbfs")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := databasefilesystem.NewServiceLinkedRole(ctx, "service_linked_role", &databasefilesystem.ServiceLinkedRoleArgs{
			ProductName: pulumi.String("AliyunServiceRoleForDbfs"),
		})
		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 serviceLinkedRole = new AliCloud.DatabaseFilesystem.ServiceLinkedRole("service_linked_role", new()
    {
        ProductName = "AliyunServiceRoleForDbfs",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.databasefilesystem.ServiceLinkedRole;
import com.pulumi.alicloud.databasefilesystem.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 serviceLinkedRole = new ServiceLinkedRole("serviceLinkedRole", ServiceLinkedRoleArgs.builder()
            .productName("AliyunServiceRoleForDbfs")
            .build());

    }
}
Copy
resources:
  serviceLinkedRole:
    type: alicloud:databasefilesystem:ServiceLinkedRole
    name: service_linked_role
    properties:
      productName: AliyunServiceRoleForDbfs
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,
                      product_name: 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:databasefilesystem: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 serviceLinkedRoleResource = new AliCloud.DatabaseFilesystem.ServiceLinkedRole("serviceLinkedRoleResource", new()
{
    ProductName = "string",
});
Copy
example, err := databasefilesystem.NewServiceLinkedRole(ctx, "serviceLinkedRoleResource", &databasefilesystem.ServiceLinkedRoleArgs{
	ProductName: pulumi.String("string"),
})
Copy
var serviceLinkedRoleResource = new ServiceLinkedRole("serviceLinkedRoleResource", ServiceLinkedRoleArgs.builder()
    .productName("string")
    .build());
Copy
service_linked_role_resource = alicloud.databasefilesystem.ServiceLinkedRole("serviceLinkedRoleResource", product_name="string")
Copy
const serviceLinkedRoleResource = new alicloud.databasefilesystem.ServiceLinkedRole("serviceLinkedRoleResource", {productName: "string"});
Copy
type: alicloud:databasefilesystem:ServiceLinkedRole
properties:
    productName: 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:

ProductName
This property is required.
Changes to this property will trigger replacement.
string
The product name for SLR. Dbfs can automatically create the following service-linked roles: AliyunServiceRoleForDbfs.
ProductName
This property is required.
Changes to this property will trigger replacement.
string
The product name for SLR. Dbfs can automatically create the following service-linked roles: AliyunServiceRoleForDbfs.
productName
This property is required.
Changes to this property will trigger replacement.
String
The product name for SLR. Dbfs can automatically create the following service-linked roles: AliyunServiceRoleForDbfs.
productName
This property is required.
Changes to this property will trigger replacement.
string
The product name for SLR. Dbfs can automatically create the following service-linked roles: AliyunServiceRoleForDbfs.
product_name
This property is required.
Changes to this property will trigger replacement.
str
The product name for SLR. Dbfs can automatically create the following service-linked roles: AliyunServiceRoleForDbfs.
productName
This property is required.
Changes to this property will trigger replacement.
String
The product name for SLR. Dbfs can automatically create the following service-linked roles: AliyunServiceRoleForDbfs.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Status bool
The status of the service Associated role. Valid Values: true: Created. false: not created.
Id string
The provider-assigned unique ID for this managed resource.
Status bool
The status of the service Associated role. Valid Values: true: Created. false: not created.
id String
The provider-assigned unique ID for this managed resource.
status Boolean
The status of the service Associated role. Valid Values: true: Created. false: not created.
id string
The provider-assigned unique ID for this managed resource.
status boolean
The status of the service Associated role. Valid Values: true: Created. false: not created.
id str
The provider-assigned unique ID for this managed resource.
status bool
The status of the service Associated role. Valid Values: true: Created. false: not created.
id String
The provider-assigned unique ID for this managed resource.
status Boolean
The status of the service Associated role. Valid Values: true: Created. false: not created.

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,
        product_name: Optional[str] = None,
        status: Optional[bool] = 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:databasefilesystem: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:
ProductName Changes to this property will trigger replacement. string
The product name for SLR. Dbfs can automatically create the following service-linked roles: AliyunServiceRoleForDbfs.
Status bool
The status of the service Associated role. Valid Values: true: Created. false: not created.
ProductName Changes to this property will trigger replacement. string
The product name for SLR. Dbfs can automatically create the following service-linked roles: AliyunServiceRoleForDbfs.
Status bool
The status of the service Associated role. Valid Values: true: Created. false: not created.
productName Changes to this property will trigger replacement. String
The product name for SLR. Dbfs can automatically create the following service-linked roles: AliyunServiceRoleForDbfs.
status Boolean
The status of the service Associated role. Valid Values: true: Created. false: not created.
productName Changes to this property will trigger replacement. string
The product name for SLR. Dbfs can automatically create the following service-linked roles: AliyunServiceRoleForDbfs.
status boolean
The status of the service Associated role. Valid Values: true: Created. false: not created.
product_name Changes to this property will trigger replacement. str
The product name for SLR. Dbfs can automatically create the following service-linked roles: AliyunServiceRoleForDbfs.
status bool
The status of the service Associated role. Valid Values: true: Created. false: not created.
productName Changes to this property will trigger replacement. String
The product name for SLR. Dbfs can automatically create the following service-linked roles: AliyunServiceRoleForDbfs.
status Boolean
The status of the service Associated role. Valid Values: true: Created. false: not created.

Import

Dbfs service-linked roles(SLR) can be imported using the id, e.g.

$ pulumi import alicloud:databasefilesystem/serviceLinkedRole:ServiceLinkedRole example <product_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.