Skip to content

Commit

Permalink
Merge pull request #22 from iriusrisk/DE-107
Browse files Browse the repository at this point in the history
DE-107: Get ec2 metadata via curl
  • Loading branch information
adrian-iriusrisk authored Jun 14, 2023
2 parents 92e5efd + d4f9356 commit 4da9317
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
out/
*.iml

#VSC
.vscode/

# Gradle
.gradle
build/
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ plugins {
}

group 'com.continuumsecurity.elasticagent'
version '2.2.0'
version '2.2.1'

// these values that go into plugin.xml
project.ext.pluginDesc = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public static Ec2Instance create(CreateAgentRequest request, PluginSettings sett
"echo \"wrapper.app.parameter.103=NONE\" >> /usr/share/go-agent/wrapper-config/wrapper-properties.conf\n" +
"mkdir -p /var/lib/go-agent/config\n" +
"echo \"agent.auto.register.key=" + request.autoRegisterKey() + "\" > /var/lib/go-agent/config/autoregister.properties\n" +
"echo \"agent.auto.register.hostname=EA_$(ec2-metadata --instance-id | cut -d \" \" -f 2)\" >> /var/lib/go-agent/config/autoregister.properties\n" +
"echo \"agent.auto.register.elasticAgent.agentId=$(ec2-metadata --instance-id | cut -d \" \" -f 2)\" >> /var/lib/go-agent/config/autoregister.properties\n" +
"echo \"agent.auto.register.hostname=EA_$(curl http://169.254.169.254/latest/meta-data/instance-id)\" >> /var/lib/go-agent/config/autoregister.properties\n" +
"echo \"agent.auto.register.elasticAgent.agentId=$(curl http://169.254.169.254/latest/meta-data/instance-id)\" >> /var/lib/go-agent/config/autoregister.properties\n" +
"echo \"agent.auto.register.elasticAgent.pluginId=" + Constants.PLUGIN_ID + "\" >> /var/lib/go-agent/config/autoregister.properties\n" +
"chown -R go:go /var/log/go-agent/\n" +
"chown -R go:go /var/lib/go-agent/\n" +
Expand Down

0 comments on commit 4da9317

Please sign in to comment.