Wednesday, November 24, 2021

Azure : How to get Client Secret for Azure Vault

https://docs.microsoft.com/en-gb/azure/active-directory/develop/quickstart-register-app#to-add-application-credentials-or-permissions-to-access-web-apis


https://jeanpaul.cloud/2020/06/06/how-to-do-app-registration-for-enterprise-application/

AWS : EC2 Instance Public IP : Could not connect to Internet : Windows EC2 Instance

https://intellipaat.com/community/42232/aws-ec2-instances-are-not-getting-to-internet-access



For Internet Access - 

A VM should be having Public IP address if its in Public Subnet and that Subnet should have Internet Gateway and Internet Gateway should have a route in Routetable

If a VM is in Private Subnet, It should have private IP and should have access to NAT Gateway in RouteTable of that Subnet

JDK Installation

https://adoptopenjdk.net/installation.html

AWS : EC2 Instances Pricing

https://aws.amazon.com/ec2/pricing/on-demand/

AWS : IGW vs NATGW

https://medium.com/awesome-cloud/aws-vpc-difference-between-internet-gateway-and-nat-gateway-c9177e710af6


Internet Gateway (IGW) allows instances with public IPs to access the internet.
NAT Gateway (NGW) allows instances with no public IPs to access the internet.


IGW allows Outside traffic to go in

NAT-GW does not allow Outside traffic to come in, It only allows from inside to Outside


Monday, November 22, 2021

Ansible : Ansible Playbook: Ansible Tower

https://www.youtube.com/watch?v=EcnqJbxBcM0

https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html

Ansible :

  • Configuration Management 
  • YAML Based
  • Push Based Approach
  • Agentless Architecture - No agent on Target VMS - Simple SSH to Target VM
2 Parts on Local Machine/Server
1) Ansible Inventory : Client Manifest - Details of Group/Target Client VMs
2) Ansible Playbook : YAML - Job - Sections in Ansible - Yaml Configurations

The default location for inventory is a file called /etc/ansible/hosts
You can specify a different inventory file at the command line using the -i <path> option.

Michael DeHaan - Author of Ansible

Ansible was acquired by Redhat
Redhat was acquired by IBM

Ansible has a UI Centric version as well - Ansible Tower

Ansible Tower - Restful UI Web based 


Microservices: Spring Boot: Netflix : Components

https://www.optisolbusiness.com/insight/micro-services-architecture-spring-boot-and-netflix-infrastructure



Thursday, November 18, 2021

Convert Certificates into formats

https://knowledge.digicert.com/solution/SO26449.html

Best Certificate Viewer Tool : SSL Viewer : Keystore Explorer : keystore-explorer.org

 

https://keystore-explorer.org












AWS: Cloudformation : How to update Stack by a new resource

 LEARN  From Here  ->  https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/gettingstarted.templatebasics.html

https://aws.amazon.com/premiumsupport/knowledge-center/cloudformation-custom-name/

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks.html

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-whatis-howdoesitwork.html

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-update-behaviors.html

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-targetgroup.html

Update requires: No interruption


docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-get-template.html#using-cfn-updating-stacks-get-stack.CON


When updating a stack, AWS CloudFormation might interrupt resources or replace updated resources, depending on which properties you update. For more information about resource update behaviors, see Update behaviors of stack resources.

Update methods


AWS CloudFormation provides two methods for updating stacks: direct update or creating and executing change sets. When you directly update a stack, you submit changes and AWS CloudFormation immediately deploys them. Use direct updates when you want to quickly deploy your updates.


With change sets, you can preview the changes AWS CloudFormation will make to your stack, and then decide whether to apply those changes. Change sets are JSON-formatted documents that summarize the changes AWS CloudFormation will make to a stack. Use change sets when you want to ensure that AWS CloudFormation doesn't make unintentional changes or when you want to consider several options. For example, you can use a change set to verify that AWS CloudFormation won't replace your stack's database instances during an update.


Drift detection operations



Monday, November 15, 2021

AWS : Cloudformation : Create LoadBalancer and Domains

docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-loadbalancer.html?icmpid=docs_cfn_console_designer

docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/parameters-section-structure.html

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-route53-recordset.html?icmpid=docs_cfn_console_designer

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-route53.html

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-elasticloadbalancingv2-targetgroup.html?icmpid=docs_cfn_console_designer

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-elb.html

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html

  • AWS Docs 
  • AWS User-Guide-Quick Reference

https://stackoverflow.com/questions/64794787/parameter-values-specified-for-a-template-which-does-not-require-them-when-tr

https://stackoverflow.com/questions/45749424/passing-multiple-parameters-from-external-file-to-cloudformation-template-and-us

aws cloudformation create-stack --stack-name cca-cloudformation-targetgroup --template-url s3://cca-cloudformation-template/CCA-CloudFormationTemplate-TargetGroup.json --parameters s3://cca-cloudformation-template/params.json

aws cloudformation create-stack --stack-name cca-cloudformation-targetgroup --template-body file://CCA-CloudFormationTemplate-TargetGroup.json --parameters file://params.json 

AWS : How to create Route53 Domains using Cloudformation Template

https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/quickref-route53.html

Sunday, November 14, 2021

Azure : Mount Azure Storage Blob in Linux Folder : BlobFuse

https://docs.microsoft.com/en-us/azure/storage/blobs/storage-how-to-mount-container-linux

 Warning

Blobfuse doesn't guarantee 100% POSIX compliance as it simply translates requests into Blob REST APIs.

Install blobfuse

sudo apt-get install blobfuse

Configure your storage account credentials 

touch ~/fuse_connection.cfg

accountName myaccount
accountKey storageaccesskey
containerName mycontainer

Mount


sudo blobfuse ~/mycontainer --tmp-path=/mnt/resource/blobfusetmp  --config-file=/path/to/fuse_connection.cfg -o attr_timeout=240 -o entry_timeout=240 -o negative_timeout=120



Valid authentication setups:

  • Account Name & Key (authType Key)
    • Requires the accountName, accountKey and containerName specified in the config file or command line.
    • Alternatively accountName and accountKey can be specified by the following environment values instead: AZURE_STORAGE_ACCOUNT, AZURE_STORAGE_ACCESS_KEY.
  • Account Name & SAS (authType SAS)
    • Requires the accountName, containerName and sasToken specified in the config file or command line.
    • Alternatively accountName can be specified by the environment values AZURE_STORAGE_ACCOUNT
  • Managed Identity (authType MSI)
    • Single assigned identity:
      • No extra parameters needed.
    • Multiple assigned identities:
      • At least one of the following for the intended identity:
        • Client ID (Use this if you are using a custom Managed Identity endpoint)
        • Object ID
        • Resource ID
    • Add Storage Blob Data Contributor roles to this identity in the Storage account.
  • Service Principal Name (authType SPN)
    • Requires servicePrincipalClientId, servicePrincipalTenantId, servicePrincipalClientSecret specified in the config file.
    • Alternatively servicePrincipalClientSecret can be specified by the environment value AZURE_STORAGE_SPN_CLIENT_SECRET
    • AZURE_STORAGE_AAD_ENDPOINT`environment value can be used to specify a custom AAD endpoint to authenticate against
    • Add Storage Blob Data Contributor roles to this identity in the Storage account.

Linux: Delete Multiple Lines in VIM and Search for String in VIM

https://linuxize.com/post/vim-delete-line/

  • Press the Esc key to go to normal mode.
  • Place the cursor on the first line you want to delete.
  • Type 5dd and hit Enter to delete the next five lines.
----------------------------------------------------------------


The basic steps to perform a search in Vim are as follows:

  • Press /.
  • Type the search pattern.
  • Press Enter to perform the search.
  • Press n to find the next occurrence or N to find the previous occurrence.

Friday, November 12, 2021

Mount S3 Bucket onto Linux Folder : s3FS : FUSE - Filesystem in Userspace

https://levelup.gitconnected.com/how-to-mount-s3-bucket-on-an-ec2-linux-instance-df44c7885aae

https://medium.com/tensult/aws-how-to-mount-s3-bucket-using-iam-role-on-ec2-linux-instance-ad2afd4513ef

S3FS

An S3 bucket can be mounted in an AWS instance as a file system known as S3fs. S3fs is a FUSE file system that allows you to mount an Amazon S3 bucket as a local file system.

Filesystem in Userspace (FUSE) is a simple interface for userspace programs to export a virtual file system to the Linux kernel.


  • Install S3FS
  • vim /etc/passwd-s3fs [Enter AccessKey/Secret Key of AWS having full S3 Permissions]
  • Mount Bucket to a Linux Folder
          mkdir /mys3bucket
         s3fs your_bucketname -o use_cache=/tmp -o allow_other -o uid=1000 -o mp_umask=002 -o multireq_max=5 /mys3bucket

Azure - Pipeline - Add Approver for Stage

https://learn.microsoft.com/en-us/azure/devops/pipelines/process/approvals?view=azure-devops&tabs=check-pass