这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Mar 4, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentialsProvider;
import com.amazonaws.auth.DefaultAWSCredentialsProviderChain;
import com.amazonaws.regions.Region;
import com.amazonaws.regions.Regions;

import com.netflix.simianarmy.CloudClient;
import com.netflix.simianarmy.Monkey;
Expand Down Expand Up @@ -126,7 +128,15 @@ protected BasicSimianArmyContext(String... configFiles) {
account = config.getStr("simianarmy.client.aws.accountKey");
secret = config.getStr("simianarmy.client.aws.secretKey");
accountName = config.getStrOrElse("simianarmy.client.aws.accountName", "Default");
region = config.getStrOrElse("simianarmy.client.aws.region", "us-east-1");

String defaultRegion = "us-east-1";
Region currentRegion = Regions.getCurrentRegion();

if (currentRegion != null) {
defaultRegion = currentRegion.getName();
}

region = config.getStrOrElse("simianarmy.client.aws.region", defaultRegion);
GLOBAL_OWNER_TAGKEY = config.getStrOrElse("simianarmy.tags.owner", "owner");

// Check for and configure optional proxy configuration
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/client.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
### see: http://docs.aws.amazon.com/AWSSdkDocsJava/latest/DeveloperGuide/java-dg-roles.html
#simianarmy.client.aws.accountKey = fakeAccount
#simianarmy.client.aws.secretKey = fakeSecret
### Comment out the following line to detect the AWS region where the instance is running
simianarmy.client.aws.region = us-west-1

### Common account name to make it easier to identify emails by subject
Expand Down