selectel.IamS3CredentialsV1
Explore with Pulumi AI
Creates and manages S3 credentials for a service user using public API v1. S3 credentials are required to access Selectel Object Storage via S3 API. S3 credentials include Access Key and Secret Key. For more information about S3 сredentials, see the official Selectel documentation.
Note: In S3 credentials, the Secret Key is stored as raw data in a plain-text file. Learn more about sensitive data in state.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as selectel from "@pulumi/selectel";
const s3Credentials1 = new selectel.IamS3CredentialsV1("s3Credentials1", {
userId: selectel_iam_serviceuser_v1.serviceuser_1.id,
projectId: selectel_vpc_project_v2.project_1.id,
});
import pulumi
import pulumi_selectel as selectel
s3_credentials1 = selectel.IamS3CredentialsV1("s3Credentials1",
user_id=selectel_iam_serviceuser_v1["serviceuser_1"]["id"],
project_id=selectel_vpc_project_v2["project_1"]["id"])
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/selectel/v6/selectel"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := selectel.NewIamS3CredentialsV1(ctx, "s3Credentials1", &selectel.IamS3CredentialsV1Args{
UserId: pulumi.Any(selectel_iam_serviceuser_v1.Serviceuser_1.Id),
ProjectId: pulumi.Any(selectel_vpc_project_v2.Project_1.Id),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Selectel = Pulumi.Selectel;
return await Deployment.RunAsync(() =>
{
var s3Credentials1 = new Selectel.IamS3CredentialsV1("s3Credentials1", new()
{
UserId = selectel_iam_serviceuser_v1.Serviceuser_1.Id,
ProjectId = selectel_vpc_project_v2.Project_1.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.selectel.IamS3CredentialsV1;
import com.pulumi.selectel.IamS3CredentialsV1Args;
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 s3Credentials1 = new IamS3CredentialsV1("s3Credentials1", IamS3CredentialsV1Args.builder()
.userId(selectel_iam_serviceuser_v1.serviceuser_1().id())
.projectId(selectel_vpc_project_v2.project_1().id())
.build());
}
}
resources:
s3Credentials1:
type: selectel:IamS3CredentialsV1
properties:
userId: ${selectel_iam_serviceuser_v1.serviceuser_1.id}
projectId: ${selectel_vpc_project_v2.project_1.id}
Create IamS3CredentialsV1 Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new IamS3CredentialsV1(name: string, args: IamS3CredentialsV1Args, opts?: CustomResourceOptions);
@overload
def IamS3CredentialsV1(resource_name: str,
args: IamS3CredentialsV1Args,
opts: Optional[ResourceOptions] = None)
@overload
def IamS3CredentialsV1(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
user_id: Optional[str] = None,
iam_s3_credentials_v1_id: Optional[str] = None,
name: Optional[str] = None)
func NewIamS3CredentialsV1(ctx *Context, name string, args IamS3CredentialsV1Args, opts ...ResourceOption) (*IamS3CredentialsV1, error)
public IamS3CredentialsV1(string name, IamS3CredentialsV1Args args, CustomResourceOptions? opts = null)
public IamS3CredentialsV1(String name, IamS3CredentialsV1Args args)
public IamS3CredentialsV1(String name, IamS3CredentialsV1Args args, CustomResourceOptions options)
type: selectel:IamS3CredentialsV1
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 IamS3CredentialsV1Args
- 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 IamS3CredentialsV1Args
- 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 IamS3CredentialsV1Args
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args IamS3CredentialsV1Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args IamS3CredentialsV1Args
- 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 iamS3CredentialsV1Resource = new Selectel.IamS3CredentialsV1("iamS3CredentialsV1Resource", new()
{
ProjectId = "string",
UserId = "string",
IamS3CredentialsV1Id = "string",
Name = "string",
});
example, err := selectel.NewIamS3CredentialsV1(ctx, "iamS3CredentialsV1Resource", &selectel.IamS3CredentialsV1Args{
ProjectId: pulumi.String("string"),
UserId: pulumi.String("string"),
IamS3CredentialsV1Id: pulumi.String("string"),
Name: pulumi.String("string"),
})
var iamS3CredentialsV1Resource = new IamS3CredentialsV1("iamS3CredentialsV1Resource", IamS3CredentialsV1Args.builder()
.projectId("string")
.userId("string")
.iamS3CredentialsV1Id("string")
.name("string")
.build());
iam_s3_credentials_v1_resource = selectel.IamS3CredentialsV1("iamS3CredentialsV1Resource",
project_id="string",
user_id="string",
iam_s3_credentials_v1_id="string",
name="string")
const iamS3CredentialsV1Resource = new selectel.IamS3CredentialsV1("iamS3CredentialsV1Resource", {
projectId: "string",
userId: "string",
iamS3CredentialsV1Id: "string",
name: "string",
});
type: selectel:IamS3CredentialsV1
properties:
iamS3CredentialsV1Id: string
name: string
projectId: string
userId: string
IamS3CredentialsV1 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 IamS3CredentialsV1 resource accepts the following input properties:
- Project
Id string - Unique identifier of the associated project. Changing this creates new credentials. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- User
Id string - Unique identifier of the service user. Changing this creates new credentials. Retrieved from the selectel.IamServiceuserV1 resource. Learn more about Service Users.
- Iam
S3Credentials stringV1Id - Name string
- Name of the S3 credentials. Changing this creates new credentials.
- Project
Id string - Unique identifier of the associated project. Changing this creates new credentials. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- User
Id string - Unique identifier of the service user. Changing this creates new credentials. Retrieved from the selectel.IamServiceuserV1 resource. Learn more about Service Users.
- Iam
S3Credentials stringV1Id - Name string
- Name of the S3 credentials. Changing this creates new credentials.
- project
Id String - Unique identifier of the associated project. Changing this creates new credentials. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- user
Id String - Unique identifier of the service user. Changing this creates new credentials. Retrieved from the selectel.IamServiceuserV1 resource. Learn more about Service Users.
- iam
S3Credentials StringV1Id - name String
- Name of the S3 credentials. Changing this creates new credentials.
- project
Id string - Unique identifier of the associated project. Changing this creates new credentials. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- user
Id string - Unique identifier of the service user. Changing this creates new credentials. Retrieved from the selectel.IamServiceuserV1 resource. Learn more about Service Users.
- iam
S3Credentials stringV1Id - name string
- Name of the S3 credentials. Changing this creates new credentials.
- project_
id str - Unique identifier of the associated project. Changing this creates new credentials. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- user_
id str - Unique identifier of the service user. Changing this creates new credentials. Retrieved from the selectel.IamServiceuserV1 resource. Learn more about Service Users.
- iam_
s3_ strcredentials_ v1_ id - name str
- Name of the S3 credentials. Changing this creates new credentials.
- project
Id String - Unique identifier of the associated project. Changing this creates new credentials. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- user
Id String - Unique identifier of the service user. Changing this creates new credentials. Retrieved from the selectel.IamServiceuserV1 resource. Learn more about Service Users.
- iam
S3Credentials StringV1Id - name String
- Name of the S3 credentials. Changing this creates new credentials.
Outputs
All input properties are implicitly available as output properties. Additionally, the IamS3CredentialsV1 resource produces the following output properties:
- access_
key str - Access Key.
- id str
- The provider-assigned unique ID for this managed resource.
- secret_
key str - Secret Key.
Look up Existing IamS3CredentialsV1 Resource
Get an existing IamS3CredentialsV1 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?: IamS3CredentialsV1State, opts?: CustomResourceOptions): IamS3CredentialsV1
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
access_key: Optional[str] = None,
iam_s3_credentials_v1_id: Optional[str] = None,
name: Optional[str] = None,
project_id: Optional[str] = None,
secret_key: Optional[str] = None,
user_id: Optional[str] = None) -> IamS3CredentialsV1
func GetIamS3CredentialsV1(ctx *Context, name string, id IDInput, state *IamS3CredentialsV1State, opts ...ResourceOption) (*IamS3CredentialsV1, error)
public static IamS3CredentialsV1 Get(string name, Input<string> id, IamS3CredentialsV1State? state, CustomResourceOptions? opts = null)
public static IamS3CredentialsV1 get(String name, Output<String> id, IamS3CredentialsV1State state, CustomResourceOptions options)
resources: _: type: selectel:IamS3CredentialsV1 get: id: ${id}
- 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.
- Access
Key string - Access Key.
- Iam
S3Credentials stringV1Id - Name string
- Name of the S3 credentials. Changing this creates new credentials.
- Project
Id string - Unique identifier of the associated project. Changing this creates new credentials. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- Secret
Key string - Secret Key.
- User
Id string - Unique identifier of the service user. Changing this creates new credentials. Retrieved from the selectel.IamServiceuserV1 resource. Learn more about Service Users.
- Access
Key string - Access Key.
- Iam
S3Credentials stringV1Id - Name string
- Name of the S3 credentials. Changing this creates new credentials.
- Project
Id string - Unique identifier of the associated project. Changing this creates new credentials. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- Secret
Key string - Secret Key.
- User
Id string - Unique identifier of the service user. Changing this creates new credentials. Retrieved from the selectel.IamServiceuserV1 resource. Learn more about Service Users.
- access
Key String - Access Key.
- iam
S3Credentials StringV1Id - name String
- Name of the S3 credentials. Changing this creates new credentials.
- project
Id String - Unique identifier of the associated project. Changing this creates new credentials. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- secret
Key String - Secret Key.
- user
Id String - Unique identifier of the service user. Changing this creates new credentials. Retrieved from the selectel.IamServiceuserV1 resource. Learn more about Service Users.
- access
Key string - Access Key.
- iam
S3Credentials stringV1Id - name string
- Name of the S3 credentials. Changing this creates new credentials.
- project
Id string - Unique identifier of the associated project. Changing this creates new credentials. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- secret
Key string - Secret Key.
- user
Id string - Unique identifier of the service user. Changing this creates new credentials. Retrieved from the selectel.IamServiceuserV1 resource. Learn more about Service Users.
- access_
key str - Access Key.
- iam_
s3_ strcredentials_ v1_ id - name str
- Name of the S3 credentials. Changing this creates new credentials.
- project_
id str - Unique identifier of the associated project. Changing this creates new credentials. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- secret_
key str - Secret Key.
- user_
id str - Unique identifier of the service user. Changing this creates new credentials. Retrieved from the selectel.IamServiceuserV1 resource. Learn more about Service Users.
- access
Key String - Access Key.
- iam
S3Credentials StringV1Id - name String
- Name of the S3 credentials. Changing this creates new credentials.
- project
Id String - Unique identifier of the associated project. Changing this creates new credentials. Retrieved from the selectel.VpcProjectV2 resource. Learn more about Projects.
- secret
Key String - Secret Key.
- user
Id String - Unique identifier of the service user. Changing this creates new credentials. Retrieved from the selectel.IamServiceuserV1 resource. Learn more about Service Users.
Import
You can import S3 credentials:
export OS_DOMAIN_NAME=<account_id>
export OS_USERNAME=
export OS_PASSWORD=
export OS_S3_CREDENTIALS_USER_ID=<user_id>
$ pulumi import selectel:index/iamS3CredentialsV1:IamS3CredentialsV1 s3_credentials_1 <access_key>
where:
<account_id>
— Selectel account ID. The account ID is in the top right corner of the Control panel. Learn more about Registration.<username>
— Name of the service user. To get the name, in the Control panel, go to Identity & Access Management ⟶ User management ⟶ the Service users tab ⟶ copy the name of the required user. Learn more about Service Users.<password>
— Password of the service user.<user_id>
— Unique identifier of the service user who owns S3 credentials, for example,abc1bb378ac84e1234b869b77aadd2ab
. To get the ID, in the Control panel, go to Identity & Access Management ⟶ User management ⟶ the Service users tab ⟶ copy the ID under the user name.<access_key>
— Access Key from S3 сredentials. To get the Access Key, in the Control panel, go to Identity & Access Management ⟶ User management ⟶ the Service users tab ⟶ click on the service user who owns credentials ⟶ copy the Access Key in the S3 keys section.
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- selectel selectel/terraform-provider-selectel
- License
- Notes
- This Pulumi package is based on the
selectel
Terraform Provider.