1 /*
2 * Copyright 2013-2019 the original author or authors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 package org.springframework.cloud.aws.autoconfigure.context.properties;
18
19 import com.amazonaws.auth.profile.internal.AwsProfileNameLoader;
20
21 /**
22 * Properties related to AWS credentials.
23 *
24 * @author Tom Gianos
25 * @since 2.0.2
26 * @see org.springframework.cloud.aws.autoconfigure.context.ContextCredentialsAutoConfiguration
27 */
28 public class AwsCredentialsProperties {
29
30 /**
31 * The access key to be used with a static provider.
32 */
33 private String accessKey;
34
35 /**
36 * The secret key to be used with a static provider.
37 */
38 private String secretKey;
39
40 /**
41 * Configures an instance profile credentials provider with no further configuration.
42 */
43 private boolean instanceProfile = true;
44
45 /**
46 * Use the DefaultAWSCredentials Chain instead of configuring a custom credentials
47 * chain.
48 */
49 private boolean useDefaultAwsCredentialsChain;
50
51 /**
52 * The AWS profile name.
53 */
54 private String profileName = AwsProfileNameLoader.DEFAULT_PROFILE_NAME;
55
56 /**
57 * The AWS profile path.
58 */
59 private String profilePath;
60
61 public String getAccessKey() {
62 return this.accessKey;
63 }
64
65 public void setAccessKey(String accessKey) {
66 this.accessKey = accessKey;
67 }
68
69 public String getSecretKey() {
70 return this.secretKey;
71 }
72
73 public void setSecretKey(String secretKey) {
74 this.secretKey = secretKey;
75 }
76
77 public boolean isInstanceProfile() {
78 return this.instanceProfile;
79 }
80
81 public void setInstanceProfile(boolean instanceProfile) {
82 this.instanceProfile = instanceProfile;
83 }
84
85 public boolean isUseDefaultAwsCredentialsChain() {
86 return this.useDefaultAwsCredentialsChain;
87 }
88
89 public void setUseDefaultAwsCredentialsChain(boolean useDefaultAwsCredentialsChain) {
90 this.useDefaultAwsCredentialsChain = useDefaultAwsCredentialsChain;
91 }
92
93 public String getProfileName() {
94 return this.profileName;
95 }
96
97 public void setProfileName(String profileName) {
98 this.profileName = profileName;
99 }
100
101 public String getProfilePath() {
102 return this.profilePath;
103 }
104
105 public void setProfilePath(String profilePath) {
106 this.profilePath = profilePath;
107 }
108
109 }
110