awslabs / logstash-output-amazon_es

Logstash output plugin to sign and export logstash events to Amazon Elasticsearch Service
Apache License 2.0
375 stars 103 forks source link

Setting Credential Parameters #148

Open guctum opened 4 years ago

guctum commented 4 years ago

Per documentation from the readme, I'm trying to pass my credentials in as instance profile credentials as our AWS account uses a federated login and I can get temp credentials if I need to anything via CLI. I set up an instance profile with permission to talk to my elasticsearch domain. What the readme doesn't clarify is how to do this. Should I just leave the the aws_access_key_id and the aws_secret_access_key fields blank? Or just not include them at all? I have a few other problems to solve with this solution, but this will solve one of the access problems later on. I believe I am using the latest version of this plugin, I never specified a version when I installed via Logstash. Here's the .conf file for reference:


input {
        jdbc {
                jdbc_validate_connection => true
                jdbc_connection_string => "valid url"
                jdbc_user => "redacted"
                jdbc_password => "redacted"
                jdbc_driver_class => ""
                statement => "valid query"
                schedule => "*/1 * * * *"
        }
}
filter
{
        # if [@timestamp] {
        #         mutate {
        #                 add_field => { "logstash_timestamp" => "%{@timestamp}" }
        #         }
        # }
        mutate { remove_field => [ "force_matching_signature" ] }
        mutate { convert => [ "sample_time" , "string" ] }
        date { match => [ "sample_time" , "ISO8601" ] }
}
output {
        amazon_es {
                hosts => ["https://domain-info.us-east-2.es.amazonaws.com/"]
                region => "us-east-2"
                # aws_access_key_id => ""
                # aws_secret_access_key => ""
                index => "index-name"
        }

        stdout {}
}