AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Monday, Jul 11, 2022 by Pulumi

getAuthorizationToken

The CodeArtifact Authorization Token data source generates a temporary authentication token for accessing repositories in a CodeArtifact domain.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var test = Output.Create(Aws.CodeArtifact.GetAuthorizationToken.InvokeAsync(new Aws.CodeArtifact.GetAuthorizationTokenArgs
        {
            Domain = aws_codeartifact_domain.Test.Domain,
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := codeartifact.GetAuthorizationToken(ctx, &codeartifact.GetAuthorizationTokenArgs{
			Domain: aws_codeartifact_domain.Test.Domain,
		}, 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 test = Output.of(CodeartifactFunctions.getAuthorizationToken(GetAuthorizationTokenArgs.builder()
            .domain(aws_codeartifact_domain.test().domain())
            .build()));

    }
}
import pulumi
import pulumi_aws as aws

test = aws.codeartifact.get_authorization_token(domain=aws_codeartifact_domain["test"]["domain"])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = aws.codeartifact.getAuthorizationToken({
    domain: aws_codeartifact_domain.test.domain,
});
variables:
  test:
    Fn::Invoke:
      Function: aws:codeartifact:getAuthorizationToken
      Arguments:
        domain: ${aws_codeartifact_domain.test.domain}

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(domain: Optional[str] = None,
                            domain_owner: Optional[str] = None,
                            duration_seconds: Optional[int] = None,
                            opts: Optional[InvokeOptions] = None) -> GetAuthorizationTokenResult
def get_authorization_token_output(domain: Optional[pulumi.Input[str]] = None,
                            domain_owner: Optional[pulumi.Input[str]] = None,
                            duration_seconds: Optional[pulumi.Input[int]] = 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:codeartifact/getAuthorizationToken:getAuthorizationToken
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Domain string

The name of the domain that is in scope for the generated authorization token.

DomainOwner string

The account number of the AWS account that owns the domain.

DurationSeconds int

The time, in seconds, that the generated authorization token is valid. Valid values are 0 and between 900 and 43200.

Domain string

The name of the domain that is in scope for the generated authorization token.

DomainOwner string

The account number of the AWS account that owns the domain.

DurationSeconds int

The time, in seconds, that the generated authorization token is valid. Valid values are 0 and between 900 and 43200.

domain String

The name of the domain that is in scope for the generated authorization token.

domainOwner String

The account number of the AWS account that owns the domain.

durationSeconds Integer

The time, in seconds, that the generated authorization token is valid. Valid values are 0 and between 900 and 43200.

domain string

The name of the domain that is in scope for the generated authorization token.

domainOwner string

The account number of the AWS account that owns the domain.

durationSeconds number

The time, in seconds, that the generated authorization token is valid. Valid values are 0 and between 900 and 43200.

domain str

The name of the domain that is in scope for the generated authorization token.

domain_owner str

The account number of the AWS account that owns the domain.

duration_seconds int

The time, in seconds, that the generated authorization token is valid. Valid values are 0 and between 900 and 43200.

domain String

The name of the domain that is in scope for the generated authorization token.

domainOwner String

The account number of the AWS account that owns the domain.

durationSeconds Number

The time, in seconds, that the generated authorization token is valid. Valid values are 0 and between 900 and 43200.

getAuthorizationToken Result

The following output properties are available:

AuthorizationToken string

Temporary authorization token.

Domain string
DomainOwner string
Expiration string

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

Id string

The provider-assigned unique ID for this managed resource.

DurationSeconds int
AuthorizationToken string

Temporary authorization token.

Domain string
DomainOwner string
Expiration string

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

Id string

The provider-assigned unique ID for this managed resource.

DurationSeconds int
authorizationToken String

Temporary authorization token.

domain String
domainOwner String
expiration String

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

id String

The provider-assigned unique ID for this managed resource.

durationSeconds Integer
authorizationToken string

Temporary authorization token.

domain string
domainOwner string
expiration string

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

id string

The provider-assigned unique ID for this managed resource.

durationSeconds number
authorization_token str

Temporary authorization token.

domain str
domain_owner str
expiration str

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

id str

The provider-assigned unique ID for this managed resource.

duration_seconds int
authorizationToken String

Temporary authorization token.

domain String
domainOwner String
expiration String

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

id String

The provider-assigned unique ID for this managed resource.

durationSeconds Number

Package Details

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

This Pulumi package is based on the aws Terraform Provider.