OVHCloud v2.8.0 published on Wednesday, Sep 24, 2025 by OVHcloud
ovh.CloudProject.getUserS3Credential
Use this data source to retrieve the Secret Access Key of an Access Key ID associated with a public cloud project’s user.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";
const projectUsers = ovh.CloudProject.getUsers({
serviceName: "XXX",
});
// Get the user ID of a previously created user with the description "S3-User"
const users = projectUsers.then(projectUsers => .filter(user => user.description == "S3-User").map(user => (user.userId)));
const s3UserId = users[0];
const myS3Credentials = Promise.all([projectUsers, s3UserId]).then(([projectUsers, s3UserId]) => ovh.CloudProject.getUserS3Credentials({
serviceName: projectUsers.serviceName,
userId: s3UserId,
}));
const myS3Credential = Promise.all([myS3Credentials, myS3Credentials, myS3Credentials]).then(([myS3Credentials, myS3Credentials1, myS3Credentials2]) => ovh.CloudProject.getUserS3Credential({
serviceName: myS3Credentials.serviceName,
userId: myS3Credentials1.userId,
accessKeyId: myS3Credentials2.accessKeyIds?.[0],
}));
export const myAccessKeyId = myS3Credential.then(myS3Credential => myS3Credential.accessKeyId);
export const mySecretAccessKey = myS3Credential.then(myS3Credential => myS3Credential.secretAccessKey);
import pulumi
import pulumi_ovh as ovh
project_users = ovh.CloudProject.get_users(service_name="XXX")
# Get the user ID of a previously created user with the description "S3-User"
users = [user.user_id for user in project_users.users if user.description == "S3-User"]
s3_user_id = users[0]
my_s3_credentials = ovh.CloudProject.get_user_s3_credentials(service_name=project_users.service_name,
user_id=s3_user_id)
my_s3_credential = ovh.CloudProject.get_user_s3_credential(service_name=my_s3_credentials.service_name,
user_id=my_s3_credentials.user_id,
access_key_id=my_s3_credentials.access_key_ids[0])
pulumi.export("myAccessKeyId", my_s3_credential.access_key_id)
pulumi.export("mySecretAccessKey", my_s3_credential.secret_access_key)
Example coming soon!
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
return await Deployment.RunAsync(() =>
{
var projectUsers = Ovh.CloudProject.GetUsers.Invoke(new()
{
ServiceName = "XXX",
});
// Get the user ID of a previously created user with the description "S3-User"
var users = .Where(user => user.Description == "S3-User").Select(user =>
{
return user.UserId;
}).ToList();
var s3UserId = users[0];
var myS3Credentials = Ovh.CloudProject.GetUserS3Credentials.Invoke(new()
{
ServiceName = projectUsers.Apply(getUsersResult => getUsersResult.ServiceName),
UserId = s3UserId,
});
var myS3Credential = Ovh.CloudProject.GetUserS3Credential.Invoke(new()
{
ServiceName = myS3Credentials.Apply(getUserS3CredentialsResult => getUserS3CredentialsResult.ServiceName),
UserId = myS3Credentials.Apply(getUserS3CredentialsResult => getUserS3CredentialsResult.UserId),
AccessKeyId = myS3Credentials.Apply(getUserS3CredentialsResult => getUserS3CredentialsResult.AccessKeyIds[0]),
});
return new Dictionary<string, object?>
{
["myAccessKeyId"] = myS3Credential.Apply(getUserS3CredentialResult => getUserS3CredentialResult.AccessKeyId),
["mySecretAccessKey"] = myS3Credential.Apply(getUserS3CredentialResult => getUserS3CredentialResult.SecretAccessKey),
};
});
Example coming soon!
Example coming soon!
Using getUserS3Credential
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getUserS3Credential(args: GetUserS3CredentialArgs, opts?: InvokeOptions): Promise<GetUserS3CredentialResult>
function getUserS3CredentialOutput(args: GetUserS3CredentialOutputArgs, opts?: InvokeOptions): Output<GetUserS3CredentialResult>def get_user_s3_credential(access_key_id: Optional[str] = None,
service_name: Optional[str] = None,
user_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetUserS3CredentialResult
def get_user_s3_credential_output(access_key_id: Optional[pulumi.Input[str]] = None,
service_name: Optional[pulumi.Input[str]] = None,
user_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetUserS3CredentialResult]func GetUserS3Credential(ctx *Context, args *GetUserS3CredentialArgs, opts ...InvokeOption) (*GetUserS3CredentialResult, error)
func GetUserS3CredentialOutput(ctx *Context, args *GetUserS3CredentialOutputArgs, opts ...InvokeOption) GetUserS3CredentialResultOutput> Note: This function is named GetUserS3Credential in the Go SDK.
public static class GetUserS3Credential
{
public static Task<GetUserS3CredentialResult> InvokeAsync(GetUserS3CredentialArgs args, InvokeOptions? opts = null)
public static Output<GetUserS3CredentialResult> Invoke(GetUserS3CredentialInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetUserS3CredentialResult> getUserS3Credential(GetUserS3CredentialArgs args, InvokeOptions options)
public static Output<GetUserS3CredentialResult> getUserS3Credential(GetUserS3CredentialArgs args, InvokeOptions options)
fn::invoke:
function: ovh:CloudProject/getUserS3Credential:getUserS3Credential
arguments:
# arguments dictionaryThe following arguments are supported:
- Access
Key stringId - the Access Key ID
- Service
Name string - The ID of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. - User
Id string - The ID of a public cloud project's user.
- Access
Key stringId - the Access Key ID
- Service
Name string - The ID of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. - User
Id string - The ID of a public cloud project's user.
- access
Key StringId - the Access Key ID
- service
Name String - The ID of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. - user
Id String - The ID of a public cloud project's user.
- access
Key stringId - the Access Key ID
- service
Name string - The ID of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. - user
Id string - The ID of a public cloud project's user.
- access_
key_ strid - the Access Key ID
- service_
name str - The ID of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. - user_
id str - The ID of a public cloud project's user.
- access
Key StringId - the Access Key ID
- service
Name String - The ID of the public cloud project. If omitted, the
OVH_CLOUD_PROJECT_SERVICEenvironment variable is used. - user
Id String - The ID of a public cloud project's user.
getUserS3Credential Result
The following output properties are available:
- Access
Key stringId - Id string
- The provider-assigned unique ID for this managed resource.
- Secret
Access stringKey - (Sensitive) the Secret Access Key
- Service
Name string - User
Id string
- Access
Key stringId - Id string
- The provider-assigned unique ID for this managed resource.
- Secret
Access stringKey - (Sensitive) the Secret Access Key
- Service
Name string - User
Id string
- access
Key StringId - id String
- The provider-assigned unique ID for this managed resource.
- secret
Access StringKey - (Sensitive) the Secret Access Key
- service
Name String - user
Id String
- access
Key stringId - id string
- The provider-assigned unique ID for this managed resource.
- secret
Access stringKey - (Sensitive) the Secret Access Key
- service
Name string - user
Id string
- access_
key_ strid - id str
- The provider-assigned unique ID for this managed resource.
- secret_
access_ strkey - (Sensitive) the Secret Access Key
- service_
name str - user_
id str
- access
Key StringId - id String
- The provider-assigned unique ID for this managed resource.
- secret
Access StringKey - (Sensitive) the Secret Access Key
- service
Name String - user
Id String
Package Details
- Repository
- ovh ovh/pulumi-ovh
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ovhTerraform Provider.
