Terraform error "duplicate provider configuration" - terraform-provider-aws

I have split the variables into separate files.
I don't see any duplicate resources among these 4 files
Terraform files

You have specified only one resource in instance.tf file.

Related

How do I run multiple instances war in one Liberty Server?

I have an application running as war in Liberty Server. How do I have the multiple instances of the same run in Liberty Server? Is there a way to get the name of the war inside the java code?
String completePath=getClass().getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
returned .../target/classes. No war file name.
You should be able to specify multiple <webApplication ...> elements in the server.xml with different values for the "id", "name" and "contextRoot" attributes, but specify the same "location" attribute (pointing to the actual WAR file).
As for getting the name of the WAR from the Java code, you could try using the ServletContext APIs like getServletContextName() or getContextPath() to differentiate between the multiple instances. More info in the javadoc here: https://www.openliberty.io/docs/20.0.0.10/reference/javadoc/liberty-javaee8-javadoc.html#javax/servlet/package-summary.html&class=javax/servlet/ServletContext.html&package=allclasses-frame.html

Server equivalent to application web.xml

I'm running a .war file in 3 different Servers, but for each server I need a different description in the web.xml file, that will be accessed like:
context.getInitParameter("CompanyKey")
Is there a equivalent for a server file? It's being a pain to change this file at each deploy.
Im currently using GlassFish 4.1
After some search, I found out that GlassFish holds a file called default-web.xml in the config folder.
All variables listed here takes precedence over the variables in the application (war) web.xml.
I just transferred my variables there and it worked!
Some helpful links for those searching about web.xml, context.xml and default-web.xml (it helped me to get to my answer):
https://blogs.oracle.com/alexismp/entry/how_to_use_tomcat_context
http://docs.oracle.com/cd/E19798-01/821-1752/geurd/index.html
How can I share a variable or object between two or more Servlets?
What is the glassfish alternative to context.xml

Can a flyway config file include other config files?

I'm using the flyway command line tool. I'd like to setup different configuration settings for different environments (development/testing/production), but there will be some common settings. Ideally there can be a common.properties config, along with individual environment-specific configs (e.g. production.properties)
Does flyway support including properties from multiple config files in some way?
Yes, you can by exploiting the loading order of Flyway config files (http://flywaydb.org/documentation/commandline/#configFile)
Place the common settings in either
Flyway Install Dir/conf/flyway.conf
User Home Dir/flyway.conf
Current Dir/flyway.conf
You can then put the environment-specific properties in the file you specify with
-configFile=/path/to/envspecific.conf

is it possible to have two or more merged configuration files in a project?

i am using ELMAH - Error Logging Modules And Handlers For ASP.NET in my project!
is there a way for put elmah's configuration in a separate web.config file?
mean is it possible to have two or more merged configuration files in a project?
thanks in advance
So long as you use the configSource attribute, you can use as many different files as you want.
It is common to all configuration sections (documented here).
Assuming your section group is named elmah, you can do the following:
<elmah configSource="elmah.config" />

MSBuild/WebDeploy - How to prevent it from deleting a folder and its contents

We're using TeamCity to automate MSBuild to use WebDeploy to push our application to our various servers.
For the most part, we've got this working, and great. One snag, though: we've got a folder that holds uploads that we don't want to have deleted during the publication.
How do I tell WebDeploy, "I know that folder's not in the compiled application. Ignore it. Just leave it alone."
If you're using the dirPath, filePath, or contentPath providers, you can specify the DoNotDelete rule to block deletions of files on the destination computer that do not exist on the source. The syntax to add to the command line would be -enableRule:DoNotDelete. For more information, see the provider articles mentioned and Web Deploy Rules.

Resources