Created
May 2, 2022 14:23
-
-
Save krdlab/d6648ed689950d53d21453b10163d821 to your computer and use it in GitHub Desktop.
AWS の parameter store を Java から利用する
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test.aws.ssm; | |
import com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagement; | |
import com.amazonaws.services.simplesystemsmanagement.AWSSimpleSystemsManagementClientBuilder; | |
import com.amazonaws.services.simplesystemsmanagement.model.GetParameterRequest; | |
import com.amazonaws.services.simplesystemsmanagement.model.GetParameterResult; | |
public class App { | |
public static void main(String[] args) { | |
final AWSSimpleSystemsManagement ssm = AWSSimpleSystemsManagementClientBuilder.defaultClient(); | |
final GetParameterRequest request = new GetParameterRequest().withName("test-param"); | |
final GetParameterResult result = ssm.getParameter(request); | |
System.out.println(result.getParameter().getValue()); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugins { | |
id 'application' | |
id 'com.github.johnrengelman.shadow' version '7.1.2' | |
id 'java' | |
} | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
implementation group: 'com.amazonaws', name: 'aws-java-sdk-ssm', version: '1.12.205' | |
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' | |
implementation 'com.google.guava:guava:30.1.1-jre' | |
} | |
application { | |
mainClass = 'test.aws.ssm.App' | |
} | |
jar { | |
manifest { | |
attributes 'Main-Class': 'test.aws.ssm.App' | |
} | |
} | |
shadowJar { | |
zip64 true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment