I have a Elastic Beanstalk application that is deployed with a CloudFormation json config.
I'm looking into the Cloud Development Kit atm and try to replicate the CloudFormation config I have right now from an CDK app.
But I can't find any Info according to create an Elastic Beanstalk app in CDK on higher level. If I got it right, the aim is, to write less config code and still get the same cloudformation executed.
I started experimenting using the CfnApplication from the elastic beanstalk package, but according to what I read, using any Cfn* things means I'm on the low-level end again where it's the same effort creating the configs. But I'm unable to find anything higher-level for ElasticBeanstalk :/
Therefore the question: is it even implemented yet, or did I not find what I search for?
Regards,
Luke
I was able to get a working sample environment using this:
https://github.com/aws-samples/aws-cdk-examples/tree/master/typescript/elasticbeanstalk/elasticbeanstalk-environment
It does what they say it should, in that it chooses sensible defaults, but this is just a jumping off point, as it is just a sample application. For customization, you set the attributes that are important to you, and the rest is autogenerated.
One thing to note, though - this example threw an error for me until I added the solutionStackName parameter. The example has this:
new elasticbeanstalk.CfnEnvironment(this, 'Environment', {
environmentName: 'MySampleEnvironment',
applicationName: app.applicationName,
platformArn: platform
});
and this is the working block:
new elasticbeanstalk.CfnEnvironment(this, 'Environment', {
environmentName: 'MySampleEnvironment',
applicationName: app.applicationName,
platformArn: platform,
solutionStackName: '64bit Amazon Linux 2018.03 v2.12.10 running Docker 18.06.1-ce'
});
The solution stack value just needs to be the valid solution stack name for the platform you are running.
Hope that helps!
Related
Recently I've been playing around with the edge-runtime and finally set things to work normally on my local environment with different routes path handled by some of my custom implementations under fetch event. and these are running under edge-runtime
And with some digging around, to be able to deploy what I've made to Vercel I have to convert my project to nextjs and exposed the config to ensure it to run on the experimental-edge runtime
What I want to ask here is
Is there a way I can deploy my edge-runtime API to Vercel without having to convert my project to NextJS
Thank you
No, Next is required.
use Cloudflare Workers instead for legacy fetch handler support
I have several CloudRun services running. I have the need to do some environment specific things (also because I have a docker container being built from the same sources too) in code. I searched around quite a bit to find out if I can get the following run-time:
Check if my code is running in a CloudRun instance or not
Get other environment variables like service-name, project-name, deploy-time, awake-time, region-name, etc. - for various reasons
This demo container code shows how to get that kind of information:
https://github.com/GoogleCloudPlatform/cloud-run-hello/blob/master/hello.go
Some things are available directly as environment variables like service and revision
service := os.Getenv("K_SERVICE")
revision := os.Getenv("K_REVISION")
The container contract docs page shows the full list
https://cloud.google.com/run/docs/container-contract
as well as information about the metadata server that can give you things like project-id or region.
I'm running Artifactory CPP CE 7.7.3 and Traefik v2.2 using docker-compose. The service is only available over http://localhost/ui/. Now, what I need is an option which allows to add a URL path-prefix (e. g. http://localhost/artifactroy/ui).
My Setup
I used the described setup process from the Artifactory Docs suggest it.
My docker.compose.yaml is the official extracted from the jfrog-artifactory-cpp-ce-7.7.3-compose.tar.gz: ./templates/docker-compose.yaml.
I'm using a reverse proxy (traefik). For this, I've added the necessary traefik configuration lines to the docker-compose-file. Here is a small extract what I've added:
[...]
labels:
- "traefik.http.routers.artifactory.rule=Host(`localhost`) && PathPrefix(`/ui`)"
- "traefik.http.routers.artifactory.middlewares=artifactory-stripprefix"
- "traefik.http.middlewares.artifactory-stripprefix.stripprefix.prefixes=/"
- "traefik.http.services.artifactory.loadbalancer.server.port=8082"
With this I managed to access artifactory over http://localhost/ui/.
Problem:
I have multiple small services running on my server, each of this service is accusable via http://localhost/<service-name>. This is very convenient and want to make clear that this URL is related to this service on my production server.
Because of this, I want to have an URL like http://localhost/artifactroy/ui/... instead of http://localhost/ui/...
I struggled getting artifactory setup in that way. I already managed to get a redirection from typing e. g. http://localhost/artifactroy/ to http://localhost/ui/ but this is not what I want on my production server.
What I did
Went through the documentation in hope of finding an option which I just can passt to artifactroy to add a prefix (Not successful).
Tried configure traefik two full days, to alter headers to get the repose point to http://localhost/artifactroy/ui/... (Only partially successful, redirection didn’t work afterwards)
Tried finding the configuration which is responsible for configure artifactory in $JFROG_HOME/artifactory/var/etc (Not successful)
Is this even possible? Help is highly appreciated..
This example (even though not traefic example) gives you a direction to implement it. There are certain routes already used within the product. You need to add a context over and above it to ensure all comes via the new context path.
https://jfrog.com/knowledge-base/how-to-remove-artifactory-from-the-context-url-in-artifactory-7/
I noticed that my app running in Kubernetes doesn't actually get registered in grafana unless I add the following deployer properties:
deployer.*.kubernetes.podAnnotations=prometheus.io/path:/actuator/prometheus,prometheus.io/port:8080,prometheus.io/scrape:true
Is that supposed to be the case? If so, how can I add add these deployer properties to always be there for every deployment without having to manually add it in the Freetext section before deployment.
Thank you! That helped me track down the answer. I tried putting those properties in (and I might have messed up putting them in) but they kept showing up as app properties and not deployer properties. Then I tried something very similar in the skipper config:
data:
application.yaml: |-
spring:
cloud:
skipper:
server:
platform:
kubernetes:
accounts:
default:
podAnnotations: 'prometheus.io/path:/actuator/prometheus,prometheus.io/port:8080,prometheus.io/scrape:true'
...
And it worked beautifully. Sabby, thanks again!
What you're attempting to accomplish can be solved with the help of "global" property configuration in SCDF.
See: Common Application Properties
However, please note that this method will apply the desired configurations to every stream application that SCDF deploys on the targeted platform. IMO, it is a valid use of it since you'd need metrics scraping for all the deployed apps anyway.
Also, as a FYI, a similar property is available for Task apps.
I'm investigating Grails vs. other Agile web frameworks, and one key use case I'm trying to support is the ability to modify controllers and install plugins post deployment. It appears that this isn't possible with Grails, but I want to make sure before I write it off.
As far as modifying controllers goes, it would be sufficient if the Groovlet behavior existed (compile-on-demand).
As far as plugin installs go, I understand this may be a long shot, but I thought I'd check to be sure.
For your information, I need this because I work on a product that requires a little site-specific customization, such as adding validation of simple meta-data, integrating with customer security environments, and maybe even including new controllers/pages quickly.
Out of the box, no, grails doesn't really support what you want. There may be ways to customize it but I've never looked into it. A PHP framework might be more of your ally since there is no real deployment process other than copying PHP files to a location.
That said, I personally would prefer a strict set of deployment policies. And honestly, deploying changes with Grails is as simple as running the 'grails war' command and copying that war to your servlet container. The site's downtime is negligible and if you have multiple web servers with a load-balancer, your customers should never see down time due to deployments.
Although it's not recommended for complex coding; You could execute groovy code from a string that you could store in database or a file on the fly at run time:
check out Groovy template engine:
http://groovy.codehaus.org/Groovy+Templates
but even then, you are still limited on what you can do or can't do let alone debugging will lack. you may want to consider an interpreted language; few to mention PHP/Perl/Coldfusion.