AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.9.2 published on Friday, Jun 24, 2022 by Pulumi

getAuthorizationToken

The ECR Authorization Token data source allows the authorization token, proxy endpoint, token expiration date, user name and password to be retrieved for an ECR repository.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var token = Output.Create(Aws.Ecr.GetAuthorizationToken.InvokeAsync());
    }

}
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ecr"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ecr.GetAuthorizationToken(ctx, nil, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var token = Output.of(EcrFunctions.getAuthorizationToken());

    }
}
import pulumi
import pulumi_aws as aws

token = aws.ecr.get_authorization_token()
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const token = pulumi.output(aws.ecr.getAuthorizationToken());
variables:
  token:
    Fn::Invoke:
      Function: aws:ecr:getAuthorizationToken
      Arguments: {}

Using getAuthorizationToken

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 getAuthorizationToken(args: GetAuthorizationTokenArgs, opts?: InvokeOptions): Promise<GetAuthorizationTokenResult>
function getAuthorizationTokenOutput(args: GetAuthorizationTokenOutputArgs, opts?: InvokeOptions): Output<GetAuthorizationTokenResult>
def get_authorization_token(registry_id: Optional[str] = None,
                            opts: Optional[InvokeOptions] = None) -> GetAuthorizationTokenResult
def get_authorization_token_output(registry_id: Optional[pulumi.Input[str]] = None,
                            opts: Optional[InvokeOptions] = None) -> Output[GetAuthorizationTokenResult]
func GetAuthorizationToken(ctx *Context, args *GetAuthorizationTokenArgs, opts ...InvokeOption) (*GetAuthorizationTokenResult, error)
func GetAuthorizationTokenOutput(ctx *Context, args *GetAuthorizationTokenOutputArgs, opts ...InvokeOption) GetAuthorizationTokenResultOutput

> Note: This function is named GetAuthorizationToken in the Go SDK.

public static class GetAuthorizationToken 
{
    public static Task<GetAuthorizationTokenResult> InvokeAsync(GetAuthorizationTokenArgs args, InvokeOptions? opts = null)
    public static Output<GetAuthorizationTokenResult> Invoke(GetAuthorizationTokenInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetAuthorizationTokenResult> getAuthorizationToken(GetAuthorizationTokenArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: aws:ecr/getAuthorizationToken:getAuthorizationToken
  Arguments:
    # Arguments dictionary

The following arguments are supported:

RegistryId string

AWS account ID of the ECR Repository. If not specified the default account is assumed.

RegistryId string

AWS account ID of the ECR Repository. If not specified the default account is assumed.

registryId String

AWS account ID of the ECR Repository. If not specified the default account is assumed.

registryId string

AWS account ID of the ECR Repository. If not specified the default account is assumed.

registry_id str

AWS account ID of the ECR Repository. If not specified the default account is assumed.

registryId String

AWS account ID of the ECR Repository. If not specified the default account is assumed.

getAuthorizationToken Result

The following output properties are available:

AuthorizationToken string

Temporary IAM authentication credentials to access the ECR repository encoded in base64 in the form of user_name:password.

ExpiresAt string

The time in UTC RFC3339 format when the authorization token expires.

Id string

The provider-assigned unique ID for this managed resource.

Password string

Password decoded from the authorization token.

ProxyEndpoint string

The registry URL to use in the docker login command.

UserName string

User name decoded from the authorization token.

RegistryId string
AuthorizationToken string

Temporary IAM authentication credentials to access the ECR repository encoded in base64 in the form of user_name:password.

ExpiresAt string

The time in UTC RFC3339 format when the authorization token expires.

Id string

The provider-assigned unique ID for this managed resource.

Password string

Password decoded from the authorization token.

ProxyEndpoint string

The registry URL to use in the docker login command.

UserName string

User name decoded from the authorization token.

RegistryId string
authorizationToken String

Temporary IAM authentication credentials to access the ECR repository encoded in base64 in the form of user_name:password.

expiresAt String

The time in UTC RFC3339 format when the authorization token expires.

id String

The provider-assigned unique ID for this managed resource.

password String

Password decoded from the authorization token.

proxyEndpoint String

The registry URL to use in the docker login command.

userName String

User name decoded from the authorization token.

registryId String
authorizationToken string

Temporary IAM authentication credentials to access the ECR repository encoded in base64 in the form of user_name:password.

expiresAt string

The time in UTC RFC3339 format when the authorization token expires.

id string

The provider-assigned unique ID for this managed resource.

password string

Password decoded from the authorization token.

proxyEndpoint string

The registry URL to use in the docker login command.

userName string

User name decoded from the authorization token.

registryId string
authorization_token str

Temporary IAM authentication credentials to access the ECR repository encoded in base64 in the form of user_name:password.

expires_at str

The time in UTC RFC3339 format when the authorization token expires.

id str

The provider-assigned unique ID for this managed resource.

password str

Password decoded from the authorization token.

proxy_endpoint str

The registry URL to use in the docker login command.

user_name str

User name decoded from the authorization token.

registry_id str
authorizationToken String

Temporary IAM authentication credentials to access the ECR repository encoded in base64 in the form of user_name:password.

expiresAt String

The time in UTC RFC3339 format when the authorization token expires.

id String

The provider-assigned unique ID for this managed resource.

password String

Password decoded from the authorization token.

proxyEndpoint String

The registry URL to use in the docker login command.

userName String

User name decoded from the authorization token.

registryId String

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.