AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi
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
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.
- Domain
Owner string - 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 between900
and43200
.
- Domain string
- Name of the domain that is in scope for the generated authorization token.
- Domain
Owner string - 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 between900
and43200
.
- domain String
- Name of the domain that is in scope for the generated authorization token.
- domain
Owner String - Account number of the AWS account that owns the domain.
- duration
Seconds Integer - Time, in seconds, that the generated authorization token is valid. Valid values are
0
and between900
and43200
.
- domain string
- Name of the domain that is in scope for the generated authorization token.
- domain
Owner string - Account number of the AWS account that owns the domain.
- duration
Seconds number - Time, in seconds, that the generated authorization token is valid. Valid values are
0
and between900
and43200
.
- 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 between900
and43200
.
- domain String
- Name of the domain that is in scope for the generated authorization token.
- domain
Owner String - Account number of the AWS account that owns the domain.
- duration
Seconds Number - Time, in seconds, that the generated authorization token is valid. Valid values are
0
and between900
and43200
.
getAuthorizationToken Result
The following output properties are available:
- string
- Temporary authorization token.
- Domain string
- Domain
Owner string - Expiration string
- Time in UTC RFC3339 format when the authorization token expires.
- Id string
- The provider-assigned unique ID for this managed resource.
- Duration
Seconds int
- string
- Temporary authorization token.
- Domain string
- Domain
Owner string - Expiration string
- Time in UTC RFC3339 format when the authorization token expires.
- Id string
- The provider-assigned unique ID for this managed resource.
- Duration
Seconds int
- String
- Temporary authorization token.
- domain String
- domain
Owner String - expiration String
- Time in UTC RFC3339 format when the authorization token expires.
- id String
- The provider-assigned unique ID for this managed resource.
- duration
Seconds Integer
- string
- Temporary authorization token.
- domain string
- domain
Owner string - expiration string
- Time in UTC RFC3339 format when the authorization token expires.
- id string
- The provider-assigned unique ID for this managed resource.
- duration
Seconds number
- 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
- String
- Temporary authorization token.
- domain String
- domain
Owner String - expiration String
- Time in UTC RFC3339 format when the authorization token expires.
- id String
- The provider-assigned unique ID for this managed resource.
- duration
Seconds Number
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.