I have this local in terraform:
aws-temporary = var.environment == "dev" ? "aws." : ""
now this is called in line:
name = "${var.hostname}.${local.aws-temporary}${data.aws_route53_zone.management_zone.name}"
Now when the "var.environment" is dev .. it does add the ".aws" in the name. However, when it is something else than dev .. it does not add the ".aws".
What I want is that it adds the .aws in dev and other envs.. but not add in dev2.
How would I modify the local to do that? any help would be appreciated. thank you
I would just switch the condition to:
aws-temporary = var.environment == "dev2" ? "" : "aws."
Or another variation of the same:
aws-temporary = var.environment != "dev2" ? "aws." : ""
Related
I would like to create a dynamic playlist. I am using an external bash script to generate multiple paths to audio files, I am using request.dynamic for that but it seems like it only reads the first line of the output of my bash script. Can anyone please help me? Any help or suggestion would be appreciated. Thanks
Here is my liquidsoap script :
set ("log.file.path","/home/admin/radio.log")
def my_request_function() =
result =
list.hd(default="", get_process_lines("sh testScript.sh"))
request.create(result, persistent=true)
end
m = request.dynamic(my_request_function)
m = audio_to_stereo(m)
radio = m
clock.assign_new(id="/stream",[output.icecast(%vorbis(samplerate=44100, channels=2, quality=0.3),format="audio/ogg", fallible=true, host = "ip address", port = 8080 , password="password", mount = "/test1",radio)])
Here is my bash script :
#!/bin/bash
now="$(date +'%Y-%m-%d')"
cd Playlist
cd Musique
cat $now*
and here is the result of it :
./Audio/147/n.mp3
./Audio/150/test.mp3
./Audio/308/eee.mp3
I need to execute specific api only for dedicated users from CsvTestconfig file
Test1
Test2
Test3
Test4
...
Test40
For example:
API1 to be executed only by users (Test1, Test2, Test3, Test4)
I have used below code in JMeter IF condition.
but it is not working as expected. for single condition it works fine.
${__javaScript("${LOGINUSER}" == "Test1" || "${LOGINUSER}" == "Test2" || "${LOGINUSER}" == "Test3" || "${LOGINUSER}" == "Test4")}
API2 should be executed by all other users except users (Test20, Test22, Test30)
${__javaScript("${LOGINUSER}" != "Test20" || "${LOGINUSER}" != "Test22" || "${LOGINUSER}" != "Test30")}
Appreciate if anyone can help on this.
Thanks
please use __jexl3 or __groovy as suggested and vars.get is recommended to fetch variables
I have this line of code that only has 2 options. If it is Provider Payments then use the provider_payments_work_lists_path else use the duplicate_claims_work_lists_path. Now I want to include a potential 3rd path. if the name == "Reimbursed Claims" then path them to reimbursed_claims_work_lists_path. How can I do that? Currently I have:
url = (workList.work_list_name == "Provider Payments") ? provider_payments_work_lists_path : duplicate_claims_work_lists_path
Just use a case statement:
url = case workList.work_list_name
when 'Provider Payments'
provider_payments_work_lists_path
when 'Reimbursed Claims'
reimbursed_claims_work_lists_path
else
duplicate_claims_work_lists_path
end
In several Tasks, I reference jars in my home folder.
Is there a better way to get Environment Variables than
ENV = System.getenv()
HOME = ENV['HOME']
task copyToServer(dependsOn: 'jar', type: Copy) {
from 'build/libs/'
into HOME + "/something/plugins/"
}
This sets $HOME but I was hoping that I missed some magic from the documentation.
Well; this works as well:
home = "$System.env.HOME"
It's not clear what you're aiming for.
I couldn't get the form suggested by #thoredge to work in Gradle 1.11, but this works for me:
home = System.getenv('HOME')
It helps to keep in mind that anything that works in pure Java will work in Gradle too.
In android gradle 0.4.0 you can just do:
println System.env.HOME
classpath com.android.tools.build:gradle-experimental:0.4.0
This is for Kotlin DSL (build.gradle.kts):
val myVariable = System.getenv("MY_VARIABLE_NAME") ?: "my default value"
OR
val myVariable = System.getenv("MY_VARIABLE_NAME") ?: error("Env variable not found")
OR
val environment = System.getenv()
val myVariable = environment["MY_VARIABLE_NAME"] ?: "my default value"
// OR val myVariable = environment["MY_VARIABLE_NAME"] ?: error("Env variable not found")
I did a lot of search for my problem but I did not get anything ..
in codeigniter when I use config files I do that :
my_config.php :
$config['my_title'] = ' My Title Here ' ;
$config['color'] = ' red ' ;
I can retrieve it like this :
$this->load->config('my_config', TRUE );
$data['my_title'] = $this->config->item('my_title', 'my_config');
My question is : How can I get the full array to deal with it ?
I want the $config as an array to do something like this :
foreach($config as $key=>$val){
$data[$key] = $val ;
}
so I do not have to write all my variables that in config file like this :
$data['my_title'] = $this->config->item('my_title', 'my_config');
$data['color'] = $this->config->item('color', 'my_config');
and so on ..
sorry for my broken English !
thanks in advance ;)
While this is undocumented, and might break in future releases, you can access the main config array by:
$config = $this->config->config;
$config=$this->load->config('my_config', TRUE );
$config = $this->config;
$my_config=$config->config['my_config'];
echo"<pre>";print_r($my_config);
It may help you..
If you get multidimentional array from config files in Codeigniter
then
In application/config/config.php
$config['name']='array_name';
In Model or Controller file
$variable = $this->config->item('name');
var_dump($variable);