All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.linguarobot.aws.cdk.maven.ResolvedEnvironment Maven / Gradle / Ivy

Go to download

The AWS CDK Maven plugin produces and deploys CloudFormation templates based on the cloud infrastructure defined by means of CDK. The goal of the project is to improve the experience of Java developers while working with CDK by eliminating the need for installing Node.js and interacting with the CDK application by means of CDK Toolkit.

There is a newer version: 0.0.8
Show newest version
package io.linguarobot.aws.cdk.maven;

import software.amazon.awssdk.auth.credentials.AwsCredentials;
import software.amazon.awssdk.auth.credentials.AwsCredentialsProvider;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.regions.Region;

/**
 * Represents a resolved execution environment.
 */
public class ResolvedEnvironment {

    private final String name;
    private final Region region;
    private final String account;
    private final AwsCredentialsProvider credentialsProvider;

    public ResolvedEnvironment(Region region, String account, AwsCredentials credentials) {
        this.name = "aws://" + account + "/" + region;
        this.region = region;
        this.account = account;
        this.credentialsProvider = StaticCredentialsProvider.create(credentials);
    }

    public String getName() {
        return name;
    }

    public Region getRegion() {
        return region;
    }

    public String getAccount() {
        return account;
    }

    public AwsCredentials getCredentials() {
        return credentialsProvider.resolveCredentials();
    }

    public AwsCredentialsProvider getCredentialsProvider() {
        return credentialsProvider;
    }

    @Override
    public String toString() {
        return getName();
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy