1. Packages
  2. AWS
  3. API Docs
  4. codeartifact
  5. getAuthorizationToken
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.codeartifact.getAuthorizationToken

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const test = aws.codeartifact.getAuthorizationToken({
        domain: testAwsCodeartifactDomain.domain,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    test = aws.codeartifact.get_authorization_token(domain=test_aws_codeartifact_domain["domain"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/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: testAwsCodeartifactDomain.Domain,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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 = testAwsCodeartifactDomain.Domain,
        });
    
    });
    
    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(testAwsCodeartifactDomain.domain())
                .build());
    
        }
    }
    
    variables:
      test:
        fn::invoke:
          Function: aws:codeartifact:getAuthorizationToken
          Arguments:
            domain: ${testAwsCodeartifactDomain.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.
    aws logo
    AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi