ana@DESKTOP-U0ULQ81:/mnt/c/Users/it/cloudana_git/LDM_GIT/ldm/ldm$ packer build -force -var "latest_ldm=$latest_ldm" -var-file="marketplace.pkrvars.hcl" test.pkr.hcl
amazon-ebs.example: output will be in this color.
azure-arm.example: output will be in this color.
==> azure-arm.example: Running builder ...
==> azure-arm.example: Getting tokens using device flow
==> azure-arm.example: Getting token for https://management.azure.com/
==> azure-arm.example: Loading auth token from file: /home/ana/.azure/packer/oauth-184a7bbc-05d1-4814-acdb-8647136eff21mgmt.json
==> azure-arm.example: Auth token found in file: /home/ana/.azure/packer/oauth-184a7bbc-05d1-4814-acdb-8647136eff21mgmt.json
==> amazon-ebs.example: Force Deregister flag found, skipping prevalidating AMI Name
==> azure-arm.example: Azure token expired. Saving the refreshed token...
==> azure-arm.example: Getting tokens using device flow
==> azure-arm.example: Getting token for Vault resource
==> azure-arm.example: Loading auth token from file: /home/ana/.azure/packer/oauth-184a7bbc-05d1-4814-acdb-8647136eff21vault.json
==> azure-arm.example: Auth token found in file: /home/ana/.azure/packer/oauth-184a7bbc-05d1-4814-acdb-8647136eff21vault.json
==> azure-arm.example: Azure token expired. Saving the refreshed token...
azure-arm.example: Creating Azure Resource Manager (ARM) client ...
amazon-ebs.example: Found Image ID: ami-08895422b5f3aa64a
==> azure-arm.example: the managed image named Libelle_LDM already exists, but deleting it due to -force flag
==> amazon-ebs.example: Creating temporary keypair: packer_622b3a93-bb94-8673-5b82-e56a9a081404
==> amazon-ebs.example: Creating temporary security group for this instance: packer_622b3a9b-d817-380d-c165-32d7af756a31
==> amazon-ebs.example: Authorizing access to port 22 from [0.0.0.0/0] in the temporary security groups...
==> amazon-ebs.example: Launching a source AWS instance...
==> amazon-ebs.example: Adding tags to source instance
amazon-ebs.example: Adding tag: "Name": "Packer Builder"
amazon-ebs.example: Instance ID: i-06c3b933e29eeb25a
==> amazon-ebs.example: Waiting for instance (i-06c3b933e29eeb25a) to become ready...
==> amazon-ebs.example: Using SSH communicator to connect: 3.80.122.83
==> amazon-ebs.example: Waiting for SSH to become available...
==> azure-arm.example: WARNING: Zone resiliency may not be supported in germanywestcentral, checkout the docs at https://docs.microsoft.com/en-us/azure/availability-zones/
==> azure-arm.example: Getting source image id for the deployment ...
==> azure-arm.example: -> SourceImageName: '/subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/providers/Microsoft.Compute/locations/germanywestcentral/publishers/SUSE/ArtifactTypes/vmimage/offers/sles-15-sp3/skus/gen1/versions/latest'
==> azure-arm.example: Creating resource group ...
==> azure-arm.example: -> ResourceGroupName : 'pkr-Resource-Group-3y9lidviyh'
==> azure-arm.example: -> Location : 'germanywestcentral'
==> azure-arm.example: -> Tags :
==> azure-arm.example: Validating deployment template ...
==> azure-arm.example: -> ResourceGroupName : 'pkr-Resource-Group-3y9lidviyh'
==> azure-arm.example: -> DeploymentName : 'pkrdp3y9lidviyh'
==> azure-arm.example: Deploying deployment template ...
==> azure-arm.example: -> ResourceGroupName : 'pkr-Resource-Group-3y9lidviyh'
==> azure-arm.example: -> DeploymentName : 'pkrdp3y9lidviyh'
==> amazon-ebs.example: Connected to SSH!
==> amazon-ebs.example: Uploading util_files/firstboot_ldm.sh => /tmp/
amazon-ebs.example: firstboot_ldm.sh 7.90 KiB / 7.90 KiB [=====================================================================================================================] 100.00%
amazon-ebs.example: firstboot_ldm.sh 7.90 KiB / 7.90 KiB [=====================================================================================================================] 100.00%
amazon-ebs.example: firstboot_ldm.sh 7.90 KiB / 7.90 KiB [=====================================================================================================================] 100.00%
amazon-ebs.example: response_ldm.txt 447 B / 447 B [===========================================================================================================================] 100.00%
amazon-ebs.example: ldm_7.7.0.0.088_linux_x86.tar.gz 34.75 MiB / 313.70 MiB [==========>--------------------------------------------------------------------------------] 11.08% 10m56s
==> azure-arm.example:
==> azure-arm.example: Getting the VM's IP address ...
==> azure-arm.example: -> ResourceGroupName : 'pkr-Resource-Group-3y9lidviyh'
==> azure-arm.example: -> PublicIPAddressName : 'pkrip3y9lidviyh'
==> azure-arm.example: -> NicName : 'pkrni3y9lidviyh'
amazon-ebs.example: firstboot_ldm.sh 7.90 KiB / 7.90 KiB [=====================================================================================================================] 100.00%
amazon-ebs.example: firstboot_ldm.sh 7.90 KiB / 7.90 KiB [=====================================================================================================================] 100.00%
amazon-ebs.example: firstboot_ldm.sh 7.90 KiB / 7.90 KiB [=====================================================================================================================] 100.00%
amazon-ebs.example: firstboot_ldm.sh 7.90 KiB / 7.90 KiB [=====================================================================================================================] 100.00%
amazon-ebs.example: firstboot_ldm.sh 7.90 KiB / 7.90 KiB [=====================================================================================================================] 100.00%
amazon-ebs.example: response_ldm.txt 447 B / 447 B [====================================================================================================================] 100.00% 14m38s
amazon-ebs.example: firstboot_ldm.sh 7.90 KiB / 7.90 KiB [==============================================================================================================] 100.00% 14m40s
amazon-ebs.example: firstboot_ldm.sh 7.90 KiB / 7.90 KiB [==============================================================================================================] 100.00% 15m13s
amazon-ebs.example: firstboot_ldm.sh 7.90 KiB / 7.90 KiB [==============================================================================================================] 100.00% 15m14s
amazon-ebs.example: response_ldm.txt 447 B / 447 B [====================================================================================================================] 100.00% 15m13s
amazon-ebs.example: firstboot_ldm.sh 7.90 KiB / 7.90 KiB [===============================================================================================================] 100.00% 16m3s
amazon-ebs.example: response_ldm.txt 447 B / 447 B [=====================================================================================================================] 100.00% 16m3s
amazon-ebs.example: ldm_7.7.0.0.088_linux_x86.tar.gz 313.70 MiB / 313.70 MiB [==========================================================================================] 100.00% 15m56s
azure-arm.example: firstboot_ldm.sh 7.90 KiB / 7.90 KiB [===============================================================================================================] 100.00% 14m33s
azure-arm.example: response_ldm.txt 447 B / 447 B [=====================================================================================================================] 100.00% 14m32s
azure-arm.example: ldm_7.7.0.0.088_linux_x86.tar.gz 313.70 MiB / 313.70 MiB [===========================================================================================] 100.00% 14m31s
==> azure-arm.example: Querying the machine's properties ...
==> azure-arm.example: -> ResourceGroupName : 'pkr-Resource-Group-3y9lidviyh'
==> azure-arm.example: -> ComputeName : 'pkrvm3y9lidviyh'
==> azure-arm.example: -> Managed OS Disk : '/subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/resourceGroups/pkr-Resource-Group-3y9lidviyh/providers/Microsoft.Compute/disks/pkros3y9lidviyh'
==> azure-arm.example: Querying the machine's additional disks properties ...
==> azure-arm.example: -> ResourceGroupName : 'pkr-Resource-Group-3y9lidviyh'
==> azure-arm.example: -> ComputeName : 'pkrvm3y9lidviyh'
==> azure-arm.example: Powering off machine ...
==> azure-arm.example: -> ResourceGroupName : 'pkr-Resource-Group-3y9lidviyh'
==> azure-arm.example: -> ComputeName : 'pkrvm3y9lidviyh'
==> amazon-ebs.example: Skipping Enable AMI deprecation...
==> amazon-ebs.example: Adding tags to AMI (ami-08de91d1e2aea5312)...
==> amazon-ebs.example: Tagging snapshot: snap-05c92dedb5e6899d5
==> amazon-ebs.example: Creating AMI tags
amazon-ebs.example: Adding tag: "created_by": "ana"
==> amazon-ebs.example: Creating snapshot tags
==> azure-arm.example: Capturing image ...
==> azure-arm.example: -> Compute ResourceGroupName : 'pkr-Resource-Group-3y9lidviyh'
==> azure-arm.example: -> Compute Name : 'pkrvm3y9lidviyh'
==> azure-arm.example: -> Compute Location : 'germanywestcentral'
==> azure-arm.example: -> Image ResourceGroupName : 'marketplace_image_resource_group'
==> azure-arm.example: -> Image Name : 'Libelle_LDM'
==> azure-arm.example: -> Image Location : 'germanywestcentral'
==> amazon-ebs.example: Terminating the source AWS instance...
==> amazon-ebs.example: Cleaning up any extra volumes...
==> amazon-ebs.example: No volumes to clean up, skipping
==> amazon-ebs.example: Deleting temporary security group...
==> amazon-ebs.example: Deleting temporary keypair...
==> amazon-ebs.example: Running post-processor: (type manifest)
Build 'amazon-ebs.example' finished after 18 minutes 16 seconds.
==> azure-arm.example: Publishing to Shared Image Gallery ...
==> azure-arm.example: -> MDI ID used for SIG publish : '/subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/resourceGroups/marketplace_image_resource_group/providers/Microsoft.Compute/images/Libelle_LDM'
==> azure-arm.example: -> SIG publish resource group : 'marketplace_resource_group'
==> azure-arm.example: -> SIG gallery name : 'marketplace_sig'
==> azure-arm.example: -> SIG image name : 'Libelle_LDM'
==> azure-arm.example: -> SIG image version : '1.1.8'
==> azure-arm.example: -> SIG replication regions : '[germanywestcentral eastus westus eastus2 westus2 northcentralus centralus southcentralus westcentralus westeurope northeurope canadacentral canadaeast uksouth ukwest]'
==> azure-arm.example: -> SIG storage account type : ''
==> azure-arm.example: -> SIG image version endoflife date : ''
==> azure-arm.example: -> SIG image version exclude from latest : 'false'
==> azure-arm.example: -> SIG replica count [1, 10] : '1'
==> azure-arm.example: -> Shared Gallery Image Version ID : '/subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/resourceGroups/marketplace_resource_group/providers/Microsoft.Compute/galleries/marketplace_sig/images/Libelle_LDM/versions/1.1.8'
==> azure-arm.example:
==> azure-arm.example: Deleting individual resources ...
==> azure-arm.example: Adding to deletion queue -> Microsoft.Compute/virtualMachines : 'pkrvm3y9lidviyh'
==> azure-arm.example: Adding to deletion queue -> Microsoft.Network/networkInterfaces : 'pkrni3y9lidviyh'
==> azure-arm.example: Adding to deletion queue -> Microsoft.Network/publicIPAddresses : 'pkrip3y9lidviyh'
==> azure-arm.example: Adding to deletion queue -> Microsoft.Network/virtualNetworks : 'pkrvn3y9lidviyh'
==> azure-arm.example: Attempting deletion -> Microsoft.Network/networkInterfaces : 'pkrni3y9lidviyh'
==> azure-arm.example: Waiting for deletion of all resources...
==> azure-arm.example: Attempting deletion -> Microsoft.Network/publicIPAddresses : 'pkrip3y9lidviyh'
==> azure-arm.example: Attempting deletion -> Microsoft.Network/virtualNetworks : 'pkrvn3y9lidviyh'
==> azure-arm.example: Attempting deletion -> Microsoft.Compute/virtualMachines : 'pkrvm3y9lidviyh'
==> azure-arm.example: Error deleting resource. Will retry.
==> azure-arm.example: Name: pkrni3y9lidviyh
==> azure-arm.example: Error: network.InterfacesClient#Delete: Failure sending request: StatusCode=0 -- Original Error: Code="NicInUse" Message="Network Interface /subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/resourceGroups/pkr-Resource-Group-3y9lidviyh/providers/Microsoft.Network/networkInterfaces/pkrni3y9lidviyh is used by existing resource /subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/resourceGroups/pkr-Resource-Group-3y9lidviyh/providers/Microsoft.Compute/virtualMachines/pkrvm3y9lidviyh. In order to delete the network interface, it must be dissociated from the resource. To learn more, see aka.ms/deletenic." Details=[]
==> azure-arm.example:
==> azure-arm.example: Error deleting resource. Will retry.
==> azure-arm.example: Name: pkrvn3y9lidviyh
==> azure-arm.example: Error: network.VirtualNetworksClient#Delete: Failure sending request: StatusCode=0 -- Original Error: Code="InUseSubnetCannotBeDeleted" Message="Subnet pkrsn3y9lidviyh is in use by /subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/resourceGroups/pkr-Resource-Group-3y9lidviyh/providers/Microsoft.Network/networkInterfaces/pkrni3y9lidviyh/ipConfigurations/ipconfig and cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet." Details=[]
==> azure-arm.example:
==> azure-arm.example: Error deleting resource. Will retry.
==> azure-arm.example: Name: pkrip3y9lidviyh
==> azure-arm.example: Error: network.PublicIPAddressesClient#Delete: Failure sending request: StatusCode=0 -- Original Error: Code="PublicIPAddressCannotBeDeleted" Message="Public IP address /subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/resourceGroups/pkr-Resource-Group-3y9lidviyh/providers/Microsoft.Network/publicIPAddresses/pkrip3y9lidviyh can not be deleted since it is still allocated to resource /subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/resourceGroups/pkr-Resource-Group-3y9lidviyh/providers/Microsoft.Network/networkInterfaces/pkrni3y9lidviyh/ipConfigurations/ipconfig. In order to delete the public IP, disassociate/detach the Public IP address from the resource. To learn how to do this, see aka.ms/deletepublicip." Details=[]
==> azure-arm.example:
==> azure-arm.example: Attempting deletion -> Microsoft.Network/networkInterfaces : 'pkrni3y9lidviyh'
==> azure-arm.example: Attempting deletion -> Microsoft.Network/virtualNetworks : 'pkrvn3y9lidviyh'
==> azure-arm.example: Attempting deletion -> Microsoft.Network/publicIPAddresses : 'pkrip3y9lidviyh'
==> azure-arm.example: Deleting -> Microsoft.Compute/disks : '/subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/resourceGroups/pkr-Resource-Group-3y9lidviyh/providers/Microsoft.Compute/disks/pkros3y9lidviyh'
==> azure-arm.example: Removing the created Deployment object: 'pkrdp3y9lidviyh'
==> azure-arm.example:
==> azure-arm.example: Cleanup requested, deleting resource group ...
==> azure-arm.example: Resource group has been deleted.
==> azure-arm.example: Running post-processor: (type manifest)
Build 'azure-arm.example' finished after 30 minutes 53 seconds.
==> Wait completed after 30 minutes 53 seconds
==> Builds finished. The artifacts of successful builds are:
--> amazon-ebs.example: AMIs were created:
us-east-1: ami-08de91d1e2aea5312
--> amazon-ebs.example: AMIs were created:
us-east-1: ami-08de91d1e2aea5312
--> azure-arm.example: Azure.ResourceManagement.VMImage:
OSType: Linux
ManagedImageResourceGroupName: marketplace_image_resource_group
ManagedImageName: Libelle_LDM
ManagedImageId: /subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/resourceGroups/marketplace_image_resource_group/providers/Microsoft.Compute/images/Libelle_LDM
ManagedImageLocation: germanywestcentral
ManagedImageSharedImageGalleryId: /subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/resourceGroups/marketplace_resource_group/providers/Microsoft.Compute/galleries/marketplace_sig/images/Libelle_LDM/versions/1.1.8
--> azure-arm.example: Azure.ResourceManagement.VMImage:
OSType: Linux
ManagedImageResourceGroupName: marketplace_image_resource_group
ManagedImageName: Libelle_LDM
ManagedImageId: /subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/resourceGroups/marketplace_image_resource_group/providers/Microsoft.Compute/images/Libelle_LDM
ManagedImageLocation: germanywestcentral
ManagedImageSharedImageGalleryId: /subscriptions/18b89270-7c7f-4a08-b956-8f1ad726e99b/resourceGroups/marketplace_resource_group/providers/Microsoft.Compute/galleries/marketplace_sig/images/Libelle_LDM/versions/1.1.8
The twelve-factor methodology is used for building software-as-a-service (SAAS) applications using any kind of programming language together with different backing services. Following this approach, it is possible to deploy an app that has minimum deviations between production and development, can be scaled and deployed to most cloud platforms without the need for system administrators or servers, and has a great connection with the base operating system. In general, these cloud-friendly applications do not only operate in the cloud — they also adopt elastic scalability, ephemeral file systems and statelessness. It is common for them to approach everything as a service which makes them easy to scale and deploy swiftly together with fast delivery of features and other changes. There are particular rules, guidelines and recommendations to follow for each factor/aspect of this methodology in order to develop a cloud-native application. Codebase The first and priority of the twelve factors is the codebase and it represents a single repository or a set of them sharing a root commit. An application must have only one codebase which is consistent across all application deployments and monitored in a version control system. One codebase is thought to have multiple deploys if the developers and their code are well organized. On the other hand, if an application is made up of a couple or more source code repositories, automating the build and deployment phases of the app's life cycle is practically impossible. Having several development teams working on a single codebase can lead to considerable problems. As a conclusion, good developer expertise, coordination and structure among the teams enable the application to have a functioning and well-organized codebase. It is certainly possible to share code across many applications using the one code, one app approach. It's also crucial to determine if shared code should be treated as a microservice or as a standalone product. If shared code is a different product, it could be included as a dependency in the app. Dependencies Modern dependency management includes an integrated server that contains everything an application needs to run in a single build artifact. Applications should always bring their dependencies to the cloud in order to be self-contained and have an embedded server. The majority of programming languages have facilities that empower developers to define dependencies and delegate duty to make sure that those dependencies are fulfilled with a certain tool. Declared dependencies must be isolated at all times. Isolation might be accomplished by examining the specified dependencies and grouping them into a sub-structure beneath or inside the application's artifact. The code can't rely on dependencies already being present on the deployment destination. Furthermore, a cloud-native application never assumes the presence of system-wide packages. Possible failures can bring down a whole server or cost a corporation a financial loss due to undetected data corruption if dependencies are not adequately isolated. The idea of repeated deployments is important to properly manage an application's dependencies, thus no assumption should be made that the runtime into which an application is deployed is not automated. If dependencies are maintained with control and consistency, applications will be one level closer to being able to operate in cloud environments. Configuration The safest approach to save and maintain an application's configuration is to use env vars, which implies externalizing and storing the config in the environment. Non-changeable components do not belong in the configuration since it comprises of components that are variable throughout different deploys. Internal information that is part of the app must not be included in configuration. To clarify, if a value is consistent across all deploys, it isn't configuration. According to twelve-factor rules, configuration should be kept distinct from code, because code doesn't vary across different deploys, but configuration often does. With this separation, it is easier to alter environment variables as no code is being affected. It's extremely important to be cautious while keeping security credentials - they should never be kept in the codebase. Bundled assets remain part of the codebase even if security credentials are stored in some properties files or retrieved from the source code. Since environment variables are maintained individually for each deploy, the application concept that contains them scales efficiently.
Oct 10, 20221 monolithic architectures and their problems 2 microservices and why both 1&2: http://aws-de-media.s3.amazonaws.com/images/AWS_Summit_Berlin_2016/sessions/pushing_the_boundaries_1300_microservices_on_aws.pdf
Aug 15, 2022AWS Lambda has over 100,000 monthly active users, does billions of monthly executions, and is available in 22 worldwide locations. Many organizations have chosen to use the Function-as-a-Service (FaaS) model to enhance their business operations while saving both time and money. AWS Lambda has a variety of fascinating use cases, and few of them will be briefly covered in this chapter. Mass Emailing Each year, many huge corporations, for example, The New York Times, must send billions of transactional emails, as well as newsletters, and other publications. Mass emailing demands technological skill and is highly expensive, but it has become a vital aspect of any marketing campaign. Simple Email Service (SES) and AWS Lambda can work together to provide a cost-effective email flow, while the email list is safely stored in Simple Storage Service (S3). General steps are: Upload CSV file A CSV file is a trigger for an S3 event That S3 event invokes a Lambda Function Lambda function adds the CSV file to DynamoDB database
Dec 17, 2021Best practice rules for AWS Lambda https://www.trendmicro.com/cloudoneconformity/knowledge-base/aws/Lambda/ also best practices, has some advices https://aws.plainenglish.io/aws-lambda-best-practices-7454da49314d --> Since serverless computing has its own set of disadvantages, it may not be appropriate for everyone or every use case. When it comes to developing Lambda code, knowing how a lambda function works may help us identify some of the best practices to follow when utilizing lambda functions, as well as the value of each best practice. Function code and dependencies, function configuration, logging and monitoring are among the key practices described below. 1. The lambda handler should be separated from service logic It is recommended that the business logic be written in a separate service layer rather than in the handler function itself. It's because it makes it much simpler to write more readable and intelligible code, as well as unit-testable code for the business logic. For example, the handler function will be an entry point for a lambda function and let's say that multiple variables are passed into the mentioned handler function. It may get problematic if each lambda triggers an event with the first parameter containing all information about the triggering event.
Dec 13, 2021or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up