Try AWS Native preview for resources not in the classic version.
aws.s3.getCanonicalUserId
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
The Canonical User ID data source allows access to the canonical user ID for the effective account in which this provider is working.
NOTE: To use this data source, you must have the
s3:ListAllMyBuckets
permission.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var current = Aws.S3.GetCanonicalUserId.Invoke();
return new Dictionary<string, object?>
{
["canonicalUserId"] = current.Apply(getCanonicalUserIdResult => getCanonicalUserIdResult.Id),
};
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
current, err := s3.GetCanonicalUserId(ctx, nil, nil)
if err != nil {
return err
}
ctx.Export("canonicalUserId", current.Id)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.S3Functions;
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) {
final var current = S3Functions.getCanonicalUserId();
ctx.export("canonicalUserId", current.applyValue(getCanonicalUserIdResult -> getCanonicalUserIdResult.id()));
}
}
import pulumi
import pulumi_aws as aws
current = aws.s3.get_canonical_user_id()
pulumi.export("canonicalUserId", current.id)
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const current = aws.s3.getCanonicalUserId({});
export const canonicalUserId = current.then(current => current.id);
variables:
current:
fn::invoke:
Function: aws:s3:getCanonicalUserId
Arguments: {}
outputs:
canonicalUserId: ${current.id}
Using getCanonicalUserId
function getCanonicalUserId(opts?: InvokeOptions): Promise<GetCanonicalUserIdResult>
def get_canonical_user_id(opts: Optional[InvokeOptions] = None) -> GetCanonicalUserIdResult
func GetCanonicalUserId(ctx *Context, opts ...InvokeOption) (*GetCanonicalUserIdResult, error)
> Note: This function is named GetCanonicalUserId
in the Go SDK.
public static class GetCanonicalUserId
{
public static Task<GetCanonicalUserIdResult> InvokeAsync(InvokeOptions? opts = null)
}
public static CompletableFuture<GetCanonicalUserIdResult> getCanonicalUserId(InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: aws:s3/getCanonicalUserId:getCanonicalUserId
arguments:
# arguments dictionary
getCanonicalUserId Result
The following output properties are available:
- Display
Name string Human-friendly name linked to the canonical user ID. The bucket owner's display name. NOTE: This value is only included in the response in the US East (N. Virginia), US West (N. California), US West (Oregon), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), EU (Ireland), and South America (São Paulo) regions.
- Id string
The provider-assigned unique ID for this managed resource.
- Display
Name string Human-friendly name linked to the canonical user ID. The bucket owner's display name. NOTE: This value is only included in the response in the US East (N. Virginia), US West (N. California), US West (Oregon), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), EU (Ireland), and South America (São Paulo) regions.
- Id string
The provider-assigned unique ID for this managed resource.
- display
Name String Human-friendly name linked to the canonical user ID. The bucket owner's display name. NOTE: This value is only included in the response in the US East (N. Virginia), US West (N. California), US West (Oregon), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), EU (Ireland), and South America (São Paulo) regions.
- id String
The provider-assigned unique ID for this managed resource.
- display
Name string Human-friendly name linked to the canonical user ID. The bucket owner's display name. NOTE: This value is only included in the response in the US East (N. Virginia), US West (N. California), US West (Oregon), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), EU (Ireland), and South America (São Paulo) regions.
- id string
The provider-assigned unique ID for this managed resource.
- display_
name str Human-friendly name linked to the canonical user ID. The bucket owner's display name. NOTE: This value is only included in the response in the US East (N. Virginia), US West (N. California), US West (Oregon), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), EU (Ireland), and South America (São Paulo) regions.
- id str
The provider-assigned unique ID for this managed resource.
- display
Name String Human-friendly name linked to the canonical user ID. The bucket owner's display name. NOTE: This value is only included in the response in the US East (N. Virginia), US West (N. California), US West (Oregon), Asia Pacific (Singapore), Asia Pacific (Sydney), Asia Pacific (Tokyo), EU (Ireland), and South America (São Paulo) regions.
- id String
The provider-assigned unique ID for this managed resource.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.