List of usage examples for com.amazonaws.services.secretsmanager.model SecretListEntry getName
public String getName()
The friendly name of the secret.
From source file:com.netflix.spinnaker.clouddriver.ecs.provider.agent.SecretCachingAgent.java
License:Open Source License
public static Map<String, Object> convertSecretToAttributes(String accountName, String region, SecretListEntry secret) { Map<String, Object> attributes = new HashMap<>(); attributes.put("account", accountName); attributes.put("region", region); attributes.put("secretName", secret.getName()); attributes.put("secretArn", secret.getARN()); return attributes; }
From source file:com.netflix.spinnaker.clouddriver.ecs.provider.agent.SecretCachingAgent.java
License:Open Source License
Map<String, Collection<CacheData>> generateFreshData(Set<SecretListEntry> secrets) {
Collection<CacheData> dataPoints = new HashSet<>();
Map<String, Collection<CacheData>> newDataMap = new HashMap<>();
for (SecretListEntry secret : secrets) {
String key = Keys.getSecretKey(accountName, region, secret.getName());
Map<String, Object> attributes = convertSecretToAttributes(accountName, region, secret);
CacheData data = new DefaultCacheData(key, attributes, Collections.emptyMap());
dataPoints.add(data);/*from w w w . ja v a2 s . com*/
}
log.info("Caching " + dataPoints.size() + " secrets in " + getAgentType());
newDataMap.put(SECRETS.toString(), dataPoints);
return newDataMap;
}