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.4Entrypoint
Return Type
AwsUtils Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@b345468623e581341e953f1b20769dce47b2620d call \
func (m *MyModule) Example() *dagger.AwsUtils {
return dag.
AwsUtils()
}@function
def example() -> dagger.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@b345468623e581341e953f1b20769dce47b2620d call \
retrieve-credentials --aws-dir DIR_PATH --aws-profile stringfunc (m *MyModule) Example(awsDir *dagger.Directory, awsProfile string) *dagger.AwsUtilsCredentials {
return dag.
AwsUtils().
RetrieveCredentials(awsDir, awsProfile)
}@function
def example(aws_dir: dagger.Directory, aws_profile: str) -> dagger.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@b345468623e581341e953f1b20769dce47b2620d call \
get-ecr-token --aws-dir DIR_PATH --aws-profile stringfunc (m *MyModule) Example(awsDir *dagger.Directory, awsProfile string) *dagger.AwsUtilsEcrToken {
return dag.
AwsUtils().
GetEcrToken(awsDir, awsProfile)
}@function
def example(aws_dir: dagger.Directory, aws_profile: str) -> dagger.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@b345468623e581341e953f1b20769dce47b2620d call \
push-to-ecr --container IMAGE:TAG --aws-dir DIR_PATH --aws-profile string --image-name string --tags string1 --tags string2func (m *MyModule) Example(ctx context.Context, container *dagger.Container, awsDir *dagger.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)
}updateLambdaImage() 🔗
UpdateLambdaImage updates the image of a Lambda function.
Return Type
Void !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| awsDir | Directory ! | - | No description provided |
| awsProfile | String ! | - | No description provided |
| functionName | String ! | - | No description provided |
| imageRef | String ! | - | No description provided |
Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@b345468623e581341e953f1b20769dce47b2620d call \
update-lambda-image --aws-dir DIR_PATH --aws-profile string --function-name string --image-ref stringfunc (m *MyModule) Example(ctx context.Context, awsDir *dagger.Directory, awsProfile string, functionName string, imageRef string) {
return dag.
AwsUtils().
UpdateLambdaImage(ctx, awsDir, awsProfile, functionName, imageRef)
}@function
async def example(aws_dir: dagger.Directory, aws_profile: str, function_name: str, image_ref: str) -> None:
return await (
dag.aws_utils()
.update_lambda_image(aws_dir, aws_profile, function_name, image_ref)
)@func()
async example(awsDir: Directory, awsProfile: string, functionName: string, imageRef: string): Promise<void> {
return dag
.awsUtils()
.updateLambdaImage(awsDir, awsProfile, functionName, imageRef)
}AwsUtilsCredentials 🔗
accessKeyId() 🔗
Return Type
Secret ! Example
dagger -m github.com/mamaar/dagger-modules/aws-utils@b345468623e581341e953f1b20769dce47b2620d call \
retrieve-credentials --aws-dir DIR_PATH --aws-profile string \
access-key-idfunc (m *MyModule) Example(awsDir *dagger.Directory, awsProfile string) *dagger.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@b345468623e581341e953f1b20769dce47b2620d call \
retrieve-credentials --aws-dir DIR_PATH --aws-profile string \
secret-access-keyfunc (m *MyModule) Example(awsDir *dagger.Directory, awsProfile string) *dagger.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@b345468623e581341e953f1b20769dce47b2620d call \
retrieve-credentials --aws-dir DIR_PATH --aws-profile string \
session-tokenfunc (m *MyModule) Example(awsDir *dagger.Directory, awsProfile string) *dagger.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@b345468623e581341e953f1b20769dce47b2620d call \
retrieve-credentials --aws-dir DIR_PATH --aws-profile string \
regionfunc (m *MyModule) Example(ctx context.Context, awsDir *dagger.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@b345468623e581341e953f1b20769dce47b2620d call \
get-ecr-token --aws-dir DIR_PATH --aws-profile string \
usernamefunc (m *MyModule) Example(ctx context.Context, awsDir *dagger.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@b345468623e581341e953f1b20769dce47b2620d call \
get-ecr-token --aws-dir DIR_PATH --aws-profile string \
passwordfunc (m *MyModule) Example(awsDir *dagger.Directory, awsProfile string) *dagger.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@b345468623e581341e953f1b20769dce47b2620d call \
get-ecr-token --aws-dir DIR_PATH --aws-profile string \
endpointfunc (m *MyModule) Example(ctx context.Context, awsDir *dagger.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()
}