aws-utils
Retrieve AWS credentials for a specific profile. Helpful for authenticating with AWS when there are multiple SSO profiles.Get ECR credentials for authenticating of simply push container images to ECR.
Installation
dagger install github.com/mamaar/dagger-modules/aws-utils@v0.0.3
Entrypoint
Return Type
AwsUtils
Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@43d70b40a7dcce67478733d17d7e2b129a3d29ac call \
func (m *myModule) example() *AwsUtils {
return dag.
AwsUtils()
}
@function
def example() -> dag.AwsUtils:
return (
dag.aws_utils()
)
@func()
example(): AwsUtils {
return dag
.awsUtils()
}
Types
AwsUtils 🔗
retrieveCredentials() 🔗
RetrieveCredentials retrieves AWS credentials for the given profile
Return Type
AwsUtilsCredentials !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
awsDir | Directory ! | - | No description provided |
awsProfile | String ! | - | No description provided |
Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@43d70b40a7dcce67478733d17d7e2b129a3d29ac call \
retrieve-credentials --aws-dir DIR_PATH --aws-profile string
func (m *myModule) example(awsDir *Directory, awsProfile string) *AwsUtilsCredentials {
return dag.
AwsUtils().
RetrieveCredentials(awsDir, awsProfile)
}
@function
def example(aws_dir: dagger.Directory, aws_profile: str) -> dag.AwsUtilsCredentials:
return (
dag.aws_utils()
.retrieve_credentials(aws_dir, aws_profile)
)
@func()
example(awsDir: Directory, awsProfile: string): AwsUtilsCredentials {
return dag
.awsUtils()
.retrieveCredentials(awsDir, awsProfile)
}
getEcrToken() 🔗
GetEcrToken retrieves an ECR token for the given profile. The token consists of username, password and endpoint.
Return Type
AwsUtilsEcrToken !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
awsDir | Directory ! | - | No description provided |
awsProfile | String ! | - | No description provided |
Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@43d70b40a7dcce67478733d17d7e2b129a3d29ac call \
get-ecr-token --aws-dir DIR_PATH --aws-profile string
func (m *myModule) example(awsDir *Directory, awsProfile string) *AwsUtilsEcrToken {
return dag.
AwsUtils().
GetEcrToken(awsDir, awsProfile)
}
@function
def example(aws_dir: dagger.Directory, aws_profile: str) -> dag.AwsUtilsEcrToken:
return (
dag.aws_utils()
.get_ecr_token(aws_dir, aws_profile)
)
@func()
example(awsDir: Directory, awsProfile: string): AwsUtilsEcrToken {
return dag
.awsUtils()
.getEcrToken(awsDir, awsProfile)
}
pushToEcr() 🔗
PushToEcr pushes a container image to ECR. It returns a list of references for the pushed images.
Return Type
[String ! ] !
Arguments
Name | Type | Default Value | Description |
---|---|---|---|
container | Container ! | - | No description provided |
awsDir | Directory ! | - | No description provided |
awsProfile | String ! | - | No description provided |
imageName | String ! | - | No description provided |
tags | [String ! ] ! | - | No description provided |
Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@43d70b40a7dcce67478733d17d7e2b129a3d29ac call \
push-to-ecr --container IMAGE:TAG --aws-dir DIR_PATH --aws-profile string --image-name string --tags string1 --tags string2
func (m *myModule) example(ctx context.Context, container *Container, awsDir *Directory, awsProfile string, imageName string, tags []string) []string {
return dag.
AwsUtils().
PushToEcr(ctx, container, awsDir, awsProfile, imageName, tags)
}
@function
async def example(container: dagger.Container, aws_dir: dagger.Directory, aws_profile: str, image_name: str, tags: List[str]) -> List[str]:
return await (
dag.aws_utils()
.push_to_ecr(container, aws_dir, aws_profile, image_name, tags)
)
@func()
async example(container: Container, awsDir: Directory, awsProfile: string, imageName: string, tags: string[]): Promise<string[]> {
return dag
.awsUtils()
.pushToEcr(container, awsDir, awsProfile, imageName, tags)
}
AwsUtilsCredentials 🔗
accessKeyId() 🔗
Return Type
Secret !
Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@43d70b40a7dcce67478733d17d7e2b129a3d29ac call \
retrieve-credentials --aws-dir DIR_PATH --aws-profile string \
access-key-id
func (m *myModule) example(awsDir *Directory, awsProfile string) *Secret {
return dag.
AwsUtils().
RetrieveCredentials(awsDir, awsProfile).
AccessKeyId()
}
@function
def example(aws_dir: dagger.Directory, aws_profile: str) -> dagger.Secret:
return (
dag.aws_utils()
.retrieve_credentials(aws_dir, aws_profile)
.access_key_id()
)
@func()
example(awsDir: Directory, awsProfile: string): Secret {
return dag
.awsUtils()
.retrieveCredentials(awsDir, awsProfile)
.accessKeyId()
}
secretAccessKey() 🔗
Return Type
Secret !
Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@43d70b40a7dcce67478733d17d7e2b129a3d29ac call \
retrieve-credentials --aws-dir DIR_PATH --aws-profile string \
secret-access-key
func (m *myModule) example(awsDir *Directory, awsProfile string) *Secret {
return dag.
AwsUtils().
RetrieveCredentials(awsDir, awsProfile).
SecretAccessKey()
}
@function
def example(aws_dir: dagger.Directory, aws_profile: str) -> dagger.Secret:
return (
dag.aws_utils()
.retrieve_credentials(aws_dir, aws_profile)
.secret_access_key()
)
@func()
example(awsDir: Directory, awsProfile: string): Secret {
return dag
.awsUtils()
.retrieveCredentials(awsDir, awsProfile)
.secretAccessKey()
}
sessionToken() 🔗
Return Type
Secret !
Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@43d70b40a7dcce67478733d17d7e2b129a3d29ac call \
retrieve-credentials --aws-dir DIR_PATH --aws-profile string \
session-token
func (m *myModule) example(awsDir *Directory, awsProfile string) *Secret {
return dag.
AwsUtils().
RetrieveCredentials(awsDir, awsProfile).
SessionToken()
}
@function
def example(aws_dir: dagger.Directory, aws_profile: str) -> dagger.Secret:
return (
dag.aws_utils()
.retrieve_credentials(aws_dir, aws_profile)
.session_token()
)
@func()
example(awsDir: Directory, awsProfile: string): Secret {
return dag
.awsUtils()
.retrieveCredentials(awsDir, awsProfile)
.sessionToken()
}
region() 🔗
Return Type
String !
Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@43d70b40a7dcce67478733d17d7e2b129a3d29ac call \
retrieve-credentials --aws-dir DIR_PATH --aws-profile string \
region
func (m *myModule) example(ctx context.Context, awsDir *Directory, awsProfile string) string {
return dag.
AwsUtils().
RetrieveCredentials(awsDir, awsProfile).
Region(ctx)
}
@function
async def example(aws_dir: dagger.Directory, aws_profile: str) -> str:
return await (
dag.aws_utils()
.retrieve_credentials(aws_dir, aws_profile)
.region()
)
@func()
async example(awsDir: Directory, awsProfile: string): Promise<string> {
return dag
.awsUtils()
.retrieveCredentials(awsDir, awsProfile)
.region()
}
AwsUtilsEcrToken 🔗
username() 🔗
Return Type
String !
Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@43d70b40a7dcce67478733d17d7e2b129a3d29ac call \
get-ecr-token --aws-dir DIR_PATH --aws-profile string \
username
func (m *myModule) example(ctx context.Context, awsDir *Directory, awsProfile string) string {
return dag.
AwsUtils().
GetEcrToken(awsDir, awsProfile).
Username(ctx)
}
@function
async def example(aws_dir: dagger.Directory, aws_profile: str) -> str:
return await (
dag.aws_utils()
.get_ecr_token(aws_dir, aws_profile)
.username()
)
@func()
async example(awsDir: Directory, awsProfile: string): Promise<string> {
return dag
.awsUtils()
.getEcrToken(awsDir, awsProfile)
.username()
}
password() 🔗
Return Type
Secret !
Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@43d70b40a7dcce67478733d17d7e2b129a3d29ac call \
get-ecr-token --aws-dir DIR_PATH --aws-profile string \
password
func (m *myModule) example(awsDir *Directory, awsProfile string) *Secret {
return dag.
AwsUtils().
GetEcrToken(awsDir, awsProfile).
Password()
}
@function
def example(aws_dir: dagger.Directory, aws_profile: str) -> dagger.Secret:
return (
dag.aws_utils()
.get_ecr_token(aws_dir, aws_profile)
.password()
)
@func()
example(awsDir: Directory, awsProfile: string): Secret {
return dag
.awsUtils()
.getEcrToken(awsDir, awsProfile)
.password()
}
endpoint() 🔗
Return Type
String !
Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@43d70b40a7dcce67478733d17d7e2b129a3d29ac call \
get-ecr-token --aws-dir DIR_PATH --aws-profile string \
endpoint
func (m *myModule) example(ctx context.Context, awsDir *Directory, awsProfile string) string {
return dag.
AwsUtils().
GetEcrToken(awsDir, awsProfile).
Endpoint(ctx)
}
@function
async def example(aws_dir: dagger.Directory, aws_profile: str) -> str:
return await (
dag.aws_utils()
.get_ecr_token(aws_dir, aws_profile)
.endpoint()
)
@func()
async example(awsDir: Directory, awsProfile: string): Promise<string> {
return dag
.awsUtils()
.getEcrToken(awsDir, awsProfile)
.endpoint()
}