How do I specify scaling triggers in .elasticbeanstalk configuration - amazon-elastic-beanstalk

My configuration generated by eb init contains the following:
[aws:autoscaling:asg]
Custom Availability Zones=
MaxSize=2
MinSize=1
How can I specify to use a different scaling trigger in the optionsettings file?
Can I perhaps use some approach through .ebextensions?

I would recommend using ebextensions for this usecase as that will give you more flexibility in the manner you deploy your code. Read about possible option setting values here.
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html
Create a .ebextensions directory in your app source. Create a file with .config extension in this directory. Use the aws:autoscaling:trigger namespace. The file should have YAML syntax.
Example Contents:
option_settings:
- namespace: aws:autoscaling:trigger
option_name: BreachDuration
value: 300
The files in the ebextensions directory are processed in alphabetical order.
More information on ebextensions here:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html

Related

Difference between tsconfig.json and tsconfig.app.json files in Angular

I'm a newbie in Angular. I used angular-cli to learn about angular and I found the files tsconfig.json and tsconfig.app.json. Both of these are typescript related and I found this link useful.
But why two such files has been used? Why can't the configurations in these two files be combined in one file? Please help me figure this out.
there is nothing that prevents you from getting rid of the tsconfig.app.json. it's just an additional config file that allows you to adjust your configuration on an app basis. this is e.g. useful when you have multiple apps in the same angular-cli workspace.
you could have the root folder with the tsconfig.json and then a sub folder app-a with a tsconfig.app.json file and another app in the sub-folder app-b with it's own tsconfig.app.json, which contains a variation of the global configuration.
the difference in configuration could e.g. be the output directory outDir or the includes or excludes used.
The difference is that tsconfig.app.json is a file that is related to the Angular App in particular, while tsconfig.json is a more general file that contains general typescript configuration. It's especially useful when you have a micro frontends system, where there are multiple Angular subprojects, each of them with its own tsconfig.app.json configuration. But if you want you could perfectly merge these two files into one, actually you surely noticed that tsconfig.app.json contains the line:
"extends": "./tsconfig.json"
which means that the whole App uses the configuration stated in tsconfig.app.json plus the configuration in tsconfig.json
Just want to add one more point.
It seems the tsconfig.app.json(App specific one) will override the tsconfig.json(global one).
My issue was with the types declaration from node not in scope of my Angular project and I was getting compile errors saying Buffer is not found.
I first added the types declaration in tsconfig.json thinking it will take effect in every app.
But I had to add it to my app-specific tsconfig.app.json file for it to take effect on my app.

How to pick path of file from System properties in jmeter CSV Data Set Config

I am trying to use CSV Data Set Config to get some data from csv file to be used in jmeter script but i don't want to hardcode the file path as it will be changing according to the test environment. Is there a way i can pick this path from System properties i.e some export set in my bashrc file.
Export in my bashrc :
export NIMBUS4_PERFORMANCE_TEST_REPO=/Users/rahul/Documents/verecloud/performancetest/data/user.csv
I would suggest the following workaround:
Change "Filename" setting of the CSV Data Set Config to following:
${__BeanShell(System.getenv().get("NIMBUS4_PERFORMANCE_TEST_REPO"))}
Where:
System.getenv() - method which provides access to underlying operating system environment variables
__Beanshell() - JMeter built-in function which allows executing of arbitrary Beanshell code
you could create a softlink at some static path. For example,
say we have created a soft link to /user/data/csvs folder.
You are in say ~/Documents , there run below
ln -s /user/data/csvs
Now we can access it in the jmeter and you will also have the flexibility to modify the softlink to point to some other location too.
Only constraint i see is the pointed directory name shouldn't change.
Hope this will help!!!
You can have just users.csv if the file is in the same folder as the .jmx itself;
You can have ${location}\users.csv
And in your UserDefinedVariables you'll have
and in non-gui mode you'll refer as
%RUNNER_HOME%\Test.jmx -Jloc=%RUNNER_HOME%\users.csv -Jusers=100 -Jloop=1 -Jrampup=5

Google Cloud Deployment Manager: Passing variables into templates

I'm using Google Cloud Deployment and I am trying to get external input into my template. Namely, I want to set a metadata variable on my instance (when creating the instance) but provide this value on execution.
I've tried:
gcloud deployment-manager deployments create test-api-backend --config test-api-backend.yaml --properties 'my_value=hello'
Which fails (The properties flag should only be used when passing in a template as your config file.)
I've tried:
my_value=hello gcloud deployment-manager deployments create test-api-backend --config test-api-backend.yaml
And use {{env['my_value']}} but the value isn't picked up.
I guess I could add the property in a .jinja file and re-write this file before I run everything, but it feels like a hack. That, or my idea of passing a variable from shell into Deploy Manager is a hack. I'm honestly not sure.
As the error message indicates, the command line properties can only be used with a template. They are essentially meant to replace the config yaml file.
The easiest thing to do is to just rename your yaml file to a .py or .jinja file. Then use that template as the file in the gcloud command instead of the yaml file.
In that new template file, add any defaults you would like if you don't pass them in on the command line.
For python, something like:
if 'myparam' in context.properties:
valuetouse = context.properities['myparam']
else:
valuetouse = mydefaultvalue
If the template uses another template then you'll also need to create a schema file for the new, top level template so you can do the imports there instead of the yaml file.
See the schema file in this github example.
https://github.com/GoogleCloudPlatform/deploymentmanager-samples/blob/master/examples/v2/igm-updater/ha-service.py.schema
If you want, you can ignore all the properties and just do the imports section.

How to specify paths in JMeter tests installation independent

This description of the CSV Data SetConfig describes that the path to a CSV file used for importing parameters should reside in the bin directory of the JMeter installation, or the path specified should be relative to that bin directory:
Save that file in the bin directory where your JMeter installation lives.
Since the installation path of JMeter is potentially (and in my case actually) different on the various machines involved, this is rather awkward.
What is the preferred way to specify such paths in a way that is independent of the installation directories and the directory the test is stored in?
You can do this:
in your path use __P function
__P(datadir)/file1.csv
When starting JMeter, pass value using -Jdatadir=<your full path to data directory>, see http://jmeter.apache.org/usermanual/get-started.html#override
Turns out that article was wrong. By accident I found out that JMeter seems to consider paths relative to the testscript it has loaded. So no need to put anything in the bin directory of JMeter itself.
Of course if you can't (or don't want) to use relative paths like that either, UBIK LOAD PACKs answer should do the trick.

Symfony 2 Config File Types

I generated a bundle and set it to use annotations for config files. But I find that in Resources/config/services.xml, its still XML? Perhaps it because I cant configure services using annotations? If so how can I make it use yml if thats the case? I could just add a YML file but I dont suppose it will be detected?
Your assumption that you can't define a service using Annotations is correct. You need to have either a services.xml or services.yml under Resources/config for the bundle.
Check out the answers to this question, it covers how to define a service using both xml, yml and through a config.yml import.
I've also written an answer here on the basics of defining a service.