I am new to serverless world. So just wondering is it possible to deploy the serverless.yml just like we deploy any other cloudformation template using AWS console etc or it is only possible through serverless CLI
This is not a direct answer, but for using regular CloudFormation tools, ideally one would like to get the transformed, raw CloudFormation template which is an outcome of serverless transformations of the SAM template.
For now, there is no build in dedicated functionality for that in SAM toolset. However, there has been a GitHub issue already made for such a feature:
cli command to transform sam template to regular cloudformation template?
The issue also indicates that sam validate --debug is a workaround on getting the raw template, not ideal though. Thus having this template with some manual fixes, a regular CloudFormation deployment can be attempted.
Related
I'm looking for an option to pick all the templates from the repository without hardcode the yml template files and in future if new templates are added, the pipeline should automatically pick all of them and do the deploy and create a single stack in aws environment, without making any modification to gitlab-ci.yml/pipeline file.
I tried using deploy CLI command, it deploy all the templates but then it goes for update and start deleting one by one and only the last template resource will be available after the pipeline execution is complete.
Let me know if there is an option to do this?
I am new to terraform and I want set up a CI/CD pipeline to GCP with github to replace a current system that use's jenkins, as we want to increase automation of deployments. What would be the best way or architecture to do this.
One of the primary products related to CI/CD is Google's Cloud Build.
https://cloud.google.com/build
It's one liner reads:
Build, test, and deploy on our serverless CI/CD platform.
It has built in triggers that include GitHub integration meaning that when events occur on GitHub, Cloud Build runs its prescribed recipes.
I'd suggest reading the documenation found at the above page and also correlate against the curated documentation found on GCP Weekly here:
Tag: CI
Tag: Cloud Build
I'm new to AWS CloudFormation stack deployment and I'm looking for resources to help me able to make a one-click deploy functionality on my company's website. The resources (a single API Gateway REST API and with two Lambda functions of which one is an authorizer) are already set up in our AWS account, but I'm looking for the quickest and most effective way to generate the CloudFormation template file from these resources that have already been set up.
I'm aware that the SAM YAML file for the Lambdas can be obtained from the Lambda console itself (under the Export dropdown). For the API Gateway REST API, the closest thing I can find is the Swagger file that can be generated under Stages. However I'm not sure if it's of any help in terms of generating the final YAML (or JSON) template file which I need to upload to CloudFormation to set up the stack.
Looking for directions, any insights would be appreciated!
There's no way to export a full CloudFormation template from any resources in AWS, especially from multiple resources together.
You can combine different exports, such as the swagger export from the REST API, and include it in your template but you will have to combine them yourself.
You can use the template designer from AWS and search for tutorials/examples online to help you out, but the full template, you'll have to create yourself.
I'm using Bitbucket Pipelines to do CD for a Serverless app. I want to use as few "build minutes" as possible for each deployment. The lifecycle of the serverless deploy command, when using AWS as the backing, seems to be:
Push the package to CloudFormation. (~60 seconds)
Sit around watching the logs from CloudFormation until the deployment finishes. (~20-30 minutes)
Because of the huge time difference, I don't want to do step two. So my question is simple: how do I deploy a serverless app such that it only does step one and returns success or failure based on whether or now CloudFormation successfully accepted the new package?
I've looked at the docs for serverless deploy and I can't see any options to enable that. Also, there seem to be AWS specific options in the serverless deploy command already, so maybe this is an option that the serverless team will consider if there is no other way to do this.
N.B. As for, "how will you know if CloudFormation fails?", for that, I would rather set up notifications to come from CloudFormation directly. The build can just have the responsibility of pushing to CloudFormation.
I don't think you can do it with serverless deploy. You can try serverless package command that will store the package in .serverless folder or you can specify the path using --package. Package will create a CloudFormation template file e.g. cloudformation-template-update-stack.json. You can then call Create Stack API action to create the stack. It will return the stack ID without waiting for all the resources to be created.
I'm creating a test environment in Azure. I want to have an accurate script of what of the configuration so it's easy to replicate for other test, pre-prod and prod environments later on. The environment has an existing subscription, and I want the entire hierarchy of resources from Resource Groups through to Web Apps to be created by script.
I'm currently rolling my own script in PowerShell utilising AzureRm. This is working well, but I can't help feel I'm reinventing the wheel. What is the existing method for creating an entire Azure environment by script?
Yes, that way is called Azure Resource Manager Templates. Quote:
With Resource Manager, you can create a template (in JSON format) that defines the infrastructure and configuration of your Azure solution. By using a template, you can repeatedly deploy your solution throughout its lifecycle and have confidence your resources are deployed in a consistent state. When you create a solution from the portal, the solution automatically includes a deployment template. You do not have to create your template from scratch because you can start with the template for your solution and customize it to meet your specific needs. You can retrieve a template for an existing resource group by either exporting the current state of the resource group, or viewing the template used for a particular deployment. Viewing the exported template is a helpful way to learn about the template syntax.
Reference: https://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview#template-deployment
Edit: you can use powershell, azure cli, azure cli2, azure sdk to deploy those templates (or simply Azure portal, search for "Template Deployment")