aws logo
AWS Classic v5.41.0, May 15 23

aws.codeartifact.getAuthorizationToken

Explore with Pulumi AI

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

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var test = Aws.CodeArtifact.GetAuthorizationToken.Invoke(new()
    {
        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 com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.codeartifact.CodeartifactFunctions;
import com.pulumi.aws.codeartifact.inputs.GetAuthorizationTokenArgs;
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 test = 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

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

DomainOwner string

Account number of the AWS account that owns the domain.

DurationSeconds int

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

Domain string

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

DomainOwner string

Account number of the AWS account that owns the domain.

DurationSeconds int

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

domain String

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

domainOwner String

Account number of the AWS account that owns the domain.

durationSeconds Integer

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

domain string

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

domainOwner string

Account number of the AWS account that owns the domain.

durationSeconds number

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

domain str

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

domain_owner str

Account number of the AWS account that owns the domain.

duration_seconds int

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

domain String

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

domainOwner String

Account number of the AWS account that owns the domain.

durationSeconds Number

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

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

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

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

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

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

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
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.