AWS configure get using aws java sdk The Next CEO of Stack OverflowIs Java “pass-by-reference” or “pass-by-value”?How do I efficiently iterate over each entry in a Java Map?Does a finally block always get executed in Java?What is the difference between public, protected, package-private and private in Java?How do I read / convert an InputStream into a String in Java?When to use LinkedList over ArrayList in Java?How do I generate random integers within a specific range in Java?How to get an enum value from a string value in Java?How do I convert a String to an int in Java?Creating a memory leak with Java

Does Germany produce more waste than the US?

How do I secure a TV wall mount?

How to show a landlord what we have in savings?

Is it OK to decorate a log book cover?

How can a day be of 24 hours?

Is a distribution that is normal, but highly skewed, considered Gaussian?

My ex-girlfriend uses my Apple ID to login to her iPad, do I have to give her my Apple ID password to reset it?

Calculating discount not working

How do I keep Mac Emacs from trapping M-`?

How can I separate the number from the unit in argument?

Does int main() need a declaration on C++?

Incomplete cube

Is it a bad idea to plug the other end of ESD strap to wall ground?

How dangerous is XSS

Is a linearly independent set whose span is dense a Schauder basis?

Is it possible to make a 9x9 table fit within the default margins?

What does this strange code stamp on my passport mean?

Salesforce opportunity stages

Which acid/base does a strong base/acid react when added to a buffer solution?

It it possible to avoid kiwi.com's automatic online check-in and instead do it manually by yourself?

Why do we say “un seul M” and not “une seule M” even though M is a “consonne”?

Why did Batya get tzaraat?

Finitely generated matrix groups whose eigenvalues are all algebraic

Why did early computer designers eschew integers?



AWS configure get using aws java sdk



The Next CEO of Stack OverflowIs Java “pass-by-reference” or “pass-by-value”?How do I efficiently iterate over each entry in a Java Map?Does a finally block always get executed in Java?What is the difference between public, protected, package-private and private in Java?How do I read / convert an InputStream into a String in Java?When to use LinkedList over ArrayList in Java?How do I generate random integers within a specific range in Java?How to get an enum value from a string value in Java?How do I convert a String to an int in Java?Creating a memory leak with Java










1















How can I get config values using the java SDK for an equivalent cli command like this: aws configure get s3.multipart_chunksize --profile profile1?



I don't see anything in the docs. I am using the aws s3 api, AmazonS3.



I am looking to store certain information from the config during object upload (aws s3 cp) as metadata, in case my configuration changes down the road, I know what config was used for a specific object.










share|improve this question


























    1















    How can I get config values using the java SDK for an equivalent cli command like this: aws configure get s3.multipart_chunksize --profile profile1?



    I don't see anything in the docs. I am using the aws s3 api, AmazonS3.



    I am looking to store certain information from the config during object upload (aws s3 cp) as metadata, in case my configuration changes down the road, I know what config was used for a specific object.










    share|improve this question
























      1












      1








      1








      How can I get config values using the java SDK for an equivalent cli command like this: aws configure get s3.multipart_chunksize --profile profile1?



      I don't see anything in the docs. I am using the aws s3 api, AmazonS3.



      I am looking to store certain information from the config during object upload (aws s3 cp) as metadata, in case my configuration changes down the road, I know what config was used for a specific object.










      share|improve this question














      How can I get config values using the java SDK for an equivalent cli command like this: aws configure get s3.multipart_chunksize --profile profile1?



      I don't see anything in the docs. I am using the aws s3 api, AmazonS3.



      I am looking to store certain information from the config during object upload (aws s3 cp) as metadata, in case my configuration changes down the road, I know what config was used for a specific object.







      java amazon-web-services amazon-s3 aws-sdk aws-cli






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 8 at 19:14









      user1738539user1738539

      901114




      901114






















          1 Answer
          1






          active

          oldest

          votes


















          0














          aws configure get pulls values from your local AWS configuration file. I would recommend storing the values that you need in environment variables instead. Then you can use them in java via System.getenv, and still use them in your CLI commands by using the ENV vars instead of pulling values from the config file. This will make your code more portable since it won't depend on having an AWS configuration file packaged with it.



          If you need to access the values from both the configuration file and from code, you could write a quick script in e.g. bash to copy the values from the config and add them as ENV vars. Another option would be to use Java system properties if you want to set the values at run time.






          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069595%2faws-configure-get-using-aws-java-sdk%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            aws configure get pulls values from your local AWS configuration file. I would recommend storing the values that you need in environment variables instead. Then you can use them in java via System.getenv, and still use them in your CLI commands by using the ENV vars instead of pulling values from the config file. This will make your code more portable since it won't depend on having an AWS configuration file packaged with it.



            If you need to access the values from both the configuration file and from code, you could write a quick script in e.g. bash to copy the values from the config and add them as ENV vars. Another option would be to use Java system properties if you want to set the values at run time.






            share|improve this answer



























              0














              aws configure get pulls values from your local AWS configuration file. I would recommend storing the values that you need in environment variables instead. Then you can use them in java via System.getenv, and still use them in your CLI commands by using the ENV vars instead of pulling values from the config file. This will make your code more portable since it won't depend on having an AWS configuration file packaged with it.



              If you need to access the values from both the configuration file and from code, you could write a quick script in e.g. bash to copy the values from the config and add them as ENV vars. Another option would be to use Java system properties if you want to set the values at run time.






              share|improve this answer

























                0












                0








                0







                aws configure get pulls values from your local AWS configuration file. I would recommend storing the values that you need in environment variables instead. Then you can use them in java via System.getenv, and still use them in your CLI commands by using the ENV vars instead of pulling values from the config file. This will make your code more portable since it won't depend on having an AWS configuration file packaged with it.



                If you need to access the values from both the configuration file and from code, you could write a quick script in e.g. bash to copy the values from the config and add them as ENV vars. Another option would be to use Java system properties if you want to set the values at run time.






                share|improve this answer













                aws configure get pulls values from your local AWS configuration file. I would recommend storing the values that you need in environment variables instead. Then you can use them in java via System.getenv, and still use them in your CLI commands by using the ENV vars instead of pulling values from the config file. This will make your code more portable since it won't depend on having an AWS configuration file packaged with it.



                If you need to access the values from both the configuration file and from code, you could write a quick script in e.g. bash to copy the values from the config and add them as ENV vars. Another option would be to use Java system properties if you want to set the values at run time.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 8 at 19:37









                bwestbwest

                7,00121847




                7,00121847





























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55069595%2faws-configure-get-using-aws-java-sdk%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    How to get text form Clipboard with JavaScript in Firefox 56?How to validate an email address in JavaScript?How do JavaScript closures work?How do I remove a property from a JavaScript object?How do you get a timestamp in JavaScript?How do I copy to the clipboard in JavaScript?How do I include a JavaScript file in another JavaScript file?Get the current URL with JavaScript?How to replace all occurrences of a string in JavaScriptHow to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?

                    Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

                    List of MPs elected to the English parliament in 1640 (April) Contents List of constituencies and members See also Notes References Navigation menueNational Archives – The Glynde Place ArchivesCobbett's Parliamentary history of England, from the Norman Conquest in 1066 to the year 1803'Aldermen in Parliament', The Aldermen of the City of London: Temp. Henry III – 1912onepage&q&f&#61, false 229