aws-cli
This module offers a generic interface to use AWS CLI in Daggeras well as some high level functions that come in handy in the context of interacting with AWS from a Dagger pipeline.
Installation
dagger install github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472Entrypoint
Return Type
AwsCli !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| version | String | - | Version (image tag) to use from the official image repository as a base container. |
| container | Container | - | Custom container to use as a base container. |
| region | String | - | Default AWS region. |
Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
func (m *MyModule) Example() *dagger.AwsCli {
return dag.
AwsCli()
}@function
def example() -> dagger.AwsCli:
return (
dag.aws_cli()
)@func()
example(): AwsCli {
return dag
.awsCli()
}Types
AwsCli 🔗
region() 🔗
Return Type
String ! Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
regionfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
AwsCli().
Region(ctx)
}@function
async def example() -> str:
return await (
dag.aws_cli()
.region()
)@func()
async example(): Promise<string> {
return dag
.awsCli()
.region()
}container() 🔗
Return Type
Container ! Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
containerfunc (m *MyModule) Example() *dagger.Container {
return dag.
AwsCli().
Container()
}@function
def example() -> dagger.Container:
return (
dag.aws_cli()
.container()
)@func()
example(): Container {
return dag
.awsCli()
.container()
}sts() 🔗
Amazon Elastic Container Registry (Amazon ECR) is a managed container image registry service.
Return Type
AwsCliSts ! Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
stsfunc (m *MyModule) Example() *dagger.AwsCliSts {
return dag.
AwsCli().
Sts()
}@function
def example() -> dagger.AwsCliSts:
return (
dag.aws_cli()
.sts()
)@func()
example(): AwsCliSts {
return dag
.awsCli()
.sts()
}withRegion() 🔗
Set a region for all AWS CLI commands.
Return Type
AwsCli !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| region | String ! | - | AWS region. |
Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
with-region --region stringfunc (m *MyModule) Example(region string) *dagger.AwsCli {
return dag.
AwsCli().
WithRegion(region)
}@function
def example(region: str) -> dagger.AwsCli:
return (
dag.aws_cli()
.with_region(region)
)@func()
example(region: string): AwsCli {
return dag
.awsCli()
.withRegion(region)
}withConfig() 🔗
Mount an AWS CLI config file.
Return Type
AwsCli !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | File ! | - | AWS config file. |
Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
with-config --source file:pathfunc (m *MyModule) Example(source *dagger.File) *dagger.AwsCli {
return dag.
AwsCli().
WithConfig(source)
}@function
def example(source: dagger.File) -> dagger.AwsCli:
return (
dag.aws_cli()
.with_config(source)
)@func()
example(source: File): AwsCli {
return dag
.awsCli()
.withConfig(source)
}withCredentials() 🔗
Mount an AWS CLI credentials file.
Return Type
AwsCli !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| source | Secret ! | - | AWS credentials file. |
Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
with-credentials --source env:MYSECRETfunc (m *MyModule) Example(source *dagger.Secret) *dagger.AwsCli {
return dag.
AwsCli().
WithCredentials(source)
}@function
def example(source: dagger.Secret) -> dagger.AwsCli:
return (
dag.aws_cli()
.with_credentials(source)
)@func()
example(source: Secret): AwsCli {
return dag
.awsCli()
.withCredentials(source)
}withProfile() 🔗
Set a profile for all AWS CLI commands.
Should be used with (at least) WithConfig.
Return Type
AwsCli !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| profile | String ! | - | AWS profile. |
Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
with-profile --profile stringfunc (m *MyModule) Example(profile string) *dagger.AwsCli {
return dag.
AwsCli().
WithProfile(profile)
}@function
def example(profile: str) -> dagger.AwsCli:
return (
dag.aws_cli()
.with_profile(profile)
)@func()
example(profile: string): AwsCli {
return dag
.awsCli()
.withProfile(profile)
}withStaticCredentials() 🔗
Set static AWS credentials.
Return Type
AwsCli !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| accessKeyId | Secret ! | - | AWS access key. |
| secretAccessKey | Secret ! | - | AWS secret key. |
| sessionToken | Secret | - | AWS session token (for temporary credentials). |
Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
with-static-credentials --access-key-id env:MYSECRET --secret-access-key env:MYSECRETfunc (m *MyModule) Example(accessKeyId *dagger.Secret, secretAccessKey *dagger.Secret) *dagger.AwsCli {
return dag.
AwsCli().
WithStaticCredentials(accessKeyId, secretAccessKey)
}@function
def example(access_key_id: dagger.Secret, secret_access_key: dagger.Secret) -> dagger.AwsCli:
return (
dag.aws_cli()
.with_static_credentials(access_key_id, secret_access_key)
)@func()
example(accessKeyId: Secret, secretAccessKey: Secret): AwsCli {
return dag
.awsCli()
.withStaticCredentials(accessKeyId, secretAccessKey)
}withoutStaticCredentials() 🔗
Remove previously set static AWS credentials.
Return Type
AwsCli ! Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
without-static-credentialsfunc (m *MyModule) Example() *dagger.AwsCli {
return dag.
AwsCli().
WithoutStaticCredentials()
}@function
def example() -> dagger.AwsCli:
return (
dag.aws_cli()
.without_static_credentials()
)@func()
example(): AwsCli {
return dag
.awsCli()
.withoutStaticCredentials()
}withTemporaryCredentials() 🔗
Set static AWS credentials (shorthand for WithStaticCredentials, making the session token a required parameter).
Return Type
AwsCli !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| accessKeyId | Secret ! | - | AWS access key. |
| secretAccessKey | Secret ! | - | AWS secret key. |
| sessionToken | Secret ! | - | AWS session token (for temporary credentials). |
Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
with-temporary-credentials --access-key-id env:MYSECRET --secret-access-key env:MYSECRET --session-token env:MYSECRETfunc (m *MyModule) Example(accessKeyId *dagger.Secret, secretAccessKey *dagger.Secret, sessionToken *dagger.Secret) *dagger.AwsCli {
return dag.
AwsCli().
WithTemporaryCredentials(accessKeyId, secretAccessKey, sessionToken)
}@function
def example(access_key_id: dagger.Secret, secret_access_key: dagger.Secret, session_token: dagger.Secret) -> dagger.AwsCli:
return (
dag.aws_cli()
.with_temporary_credentials(access_key_id, secret_access_key, session_token)
)@func()
example(accessKeyId: Secret, secretAccessKey: Secret, sessionToken: Secret): AwsCli {
return dag
.awsCli()
.withTemporaryCredentials(accessKeyId, secretAccessKey, sessionToken)
}exec() 🔗
Run an AWS CLI command.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| args | [String ! ] ! | - | Command to run (without "aws") (e.g., ["sts", "get-caller-identity"]). |
Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
exec --args string1 --args string2func (m *MyModule) Example(args []string) *dagger.Container {
return dag.
AwsCli().
Exec(args)
}@function
def example(args: List[str]) -> dagger.Container:
return (
dag.aws_cli()
.exec(args)
)@func()
example(args: string[]): Container {
return dag
.awsCli()
.exec(args)
}ecr() 🔗
Amazon Elastic Container Registry (Amazon ECR) is a managed container image registry service.
Return Type
AwsCliEcr ! Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
ecrfunc (m *MyModule) Example() *dagger.AwsCliEcr {
return dag.
AwsCli().
Ecr()
}@function
def example() -> dagger.AwsCliEcr:
return (
dag.aws_cli()
.ecr()
)@func()
example(): AwsCliEcr {
return dag
.awsCli()
.ecr()
}AwsCliSts 🔗
exec() 🔗
Run an AWS CLI command.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| args | [String ! ] ! | - | Command to run (without "aws sts"). |
Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
sts \
exec --args string1 --args string2func (m *MyModule) Example(args []string) *dagger.Container {
return dag.
AwsCli().
Sts().
Exec(args)
}@function
def example(args: List[str]) -> dagger.Container:
return (
dag.aws_cli()
.sts()
.exec(args)
)@func()
example(args: string[]): Container {
return dag
.awsCli()
.sts()
.exec(args)
}getCallerIdentity() 🔗
Returns details about the IAM user or role whose credentials are used to call the operation.
Return Type
AwsCliStsCallerIdentity ! Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
sts \
get-caller-identityfunc (m *MyModule) Example() *dagger.AwsCliStsCallerIdentity {
return dag.
AwsCli().
Sts().
GetCallerIdentity()
}@function
def example() -> dagger.AwsCliStsCallerIdentity:
return (
dag.aws_cli()
.sts()
.get_caller_identity()
)@func()
example(): AwsCliStsCallerIdentity {
return dag
.awsCli()
.sts()
.getCallerIdentity()
}AwsCliEcr 🔗
exec() 🔗
Run an AWS CLI command.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| args | [String ! ] ! | - | Command to run (without "aws ecr"). |
Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
ecr \
exec --args string1 --args string2func (m *MyModule) Example(args []string) *dagger.Container {
return dag.
AwsCli().
Ecr().
Exec(args)
}@function
def example(args: List[str]) -> dagger.Container:
return (
dag.aws_cli()
.ecr()
.exec(args)
)@func()
example(args: string[]): Container {
return dag
.awsCli()
.ecr()
.exec(args)
}getLoginPassword() 🔗
Retrieves an authentication token that you can use to authenticate to an Amazon ECR registry.
Return Type
Secret !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| region | String | - | AWS region (required to be set either globally or here). |
Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
ecr \
get-login-passwordfunc (m *MyModule) Example() *dagger.Secret {
return dag.
AwsCli().
Ecr().
GetLoginPassword()
}@function
def example() -> dagger.Secret:
return (
dag.aws_cli()
.ecr()
.get_login_password()
)@func()
example(): Secret {
return dag
.awsCli()
.ecr()
.getLoginPassword()
}login() 🔗
Create registry authentication details for an ECR registry.
Return Type
AwsCliEcrRegistry !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| accountId | String | - | Account ID to be used for assembling the registry address. (Falls back to the account ID of the caller) |
| region | String | - | AWS region (required to be set either globally or here). |
Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
ecr \
loginfunc (m *MyModule) Example() *dagger.AwsCliEcrRegistry {
return dag.
AwsCli().
Ecr().
Login()
}@function
def example() -> dagger.AwsCliEcrRegistry:
return (
dag.aws_cli()
.ecr()
.login()
)@func()
example(): AwsCliEcrRegistry {
return dag
.awsCli()
.ecr()
.login()
}AwsCliStsCallerIdentity 🔗
userId() 🔗
Return Type
String ! Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
sts \
get-caller-identity \
user-idfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
AwsCli().
Sts().
GetCallerIdentity().
UserId(ctx)
}@function
async def example() -> str:
return await (
dag.aws_cli()
.sts()
.get_caller_identity()
.user_id()
)@func()
async example(): Promise<string> {
return dag
.awsCli()
.sts()
.getCallerIdentity()
.userId()
}account() 🔗
Return Type
String ! Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
sts \
get-caller-identity \
accountfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
AwsCli().
Sts().
GetCallerIdentity().
Account(ctx)
}@function
async def example() -> str:
return await (
dag.aws_cli()
.sts()
.get_caller_identity()
.account()
)@func()
async example(): Promise<string> {
return dag
.awsCli()
.sts()
.getCallerIdentity()
.account()
}arn() 🔗
Return Type
String ! Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
sts \
get-caller-identity \
arnfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
AwsCli().
Sts().
GetCallerIdentity().
Arn(ctx)
}@function
async def example() -> str:
return await (
dag.aws_cli()
.sts()
.get_caller_identity()
.arn()
)@func()
async example(): Promise<string> {
return dag
.awsCli()
.sts()
.getCallerIdentity()
.arn()
}AwsCliEcrRegistry 🔗
address() 🔗
Return Type
String ! Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
ecr \
login \
addressfunc (m *MyModule) Example(ctx context.Context) string {
return dag.
AwsCli().
Ecr().
Login().
Address(ctx)
}@function
async def example() -> str:
return await (
dag.aws_cli()
.ecr()
.login()
.address()
)@func()
async example(): Promise<string> {
return dag
.awsCli()
.ecr()
.login()
.address()
}password() 🔗
Return Type
Secret ! Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
ecr \
login \
passwordfunc (m *MyModule) Example() *dagger.Secret {
return dag.
AwsCli().
Ecr().
Login().
Password()
}@function
def example() -> dagger.Secret:
return (
dag.aws_cli()
.ecr()
.login()
.password()
)@func()
example(): Secret {
return dag
.awsCli()
.ecr()
.login()
.password()
}auth() 🔗
Set registry authentication in a container.
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| container | Container ! | - | No description provided |
Example
dagger -m github.com/sagikazarmark/daggerverse/aws-cli@6133ad18e131b891d4723b8e25d69f5de077b472 call \
ecr \
login \
auth --container IMAGE:TAGfunc (m *MyModule) Example(container *dagger.Container) *dagger.Container {
return dag.
AwsCli().
Ecr().
Login().
Auth(container)
}@function
def example(container: dagger.Container) -> dagger.Container:
return (
dag.aws_cli()
.ecr()
.login()
.auth(container)
)@func()
example(container: Container): Container {
return dag
.awsCli()
.ecr()
.login()
.auth(container)
}