Terraform AWS Internet Gateway Tutorial (How to Create Internet Gateway in AWS) Ep 2

In this Terraform AWS Internet Gateway Tutorial, I will explain how to create Internet Gateway in AWS. We will use Terraform aws_internet_gateway resource to create AWS Internet Gateway. We will explore 3 ways to provide AWS VPC ID for AWS internet gateway. First, we will hardcode AWS VPC ID in our code, the second option is to use Terraform data source and a third way is to use terraform aws_vpc resource that we created in the previous video.

Did I help you out?
☕ Buy Me a Coffe: https://www.buymeacoffee.com/antonputra
🔴 Add me on LinkedIn: https://www.linkedin.com/in/anton-putra

=========
⏱️TIMESTAMPS⏱️
0:00 Intro
1:01 Create Terraform aws_internet_gateway resource
4:23 Run terraform commands to create AWS Infra

=========
Source Code
🌏 - Instructions: https://antonputra.com/terraform-aws-internet-gateway-tutorial

=========
SOCIAL
👥 - FACEBOOK: https://www.facebook.com/profile.php?id=100037229408982
💼 - LINKEDIN: https://www.linkedin.com/in/anton-putra

#Terraform #EKS #AWS

#aws #terraform

Terraform AWS Internet Gateway Tutorial (How to Create Internet Gateway in AWS) Ep 2

Terraform AWS Internet Gateway Tutorial (How to Create Internet Gateway in AWS) Ep 2

In this Terraform AWS Internet Gateway Tutorial, I will explain how to create Internet Gateway in AWS. We will use Terraform aws_internet_gateway resource to create AWS Internet Gateway. We will explore 3 ways to provide AWS VPC ID for AWS internet gateway. First, we will hardcode AWS VPC ID in our code, the second option is to use Terraform data source and a third way is to use terraform aws_vpc resource that we created in the previous video.

Did I help you out?
☕ Buy Me a Coffe: https://www.buymeacoffee.com/antonputra
🔴 Add me on LinkedIn: https://www.linkedin.com/in/anton-putra

=========
⏱️TIMESTAMPS⏱️
0:00 Intro
1:01 Create Terraform aws_internet_gateway resource
4:23 Run terraform commands to create AWS Infra

=========
Source Code
🌏 - Instructions: https://antonputra.com/terraform-aws-internet-gateway-tutorial

=========
SOCIAL
👥 - FACEBOOK: https://www.facebook.com/profile.php?id=100037229408982
💼 - LINKEDIN: https://www.linkedin.com/in/anton-putra

#Terraform #EKS #AWS

#aws #terraform

Terraform AWS Internet Gateway Tutorial (How to Create Internet Gateway in AWS) Ep 2
Christa  Stehr

Christa Stehr

1598408880

How To Unite AWS KMS with Serverless Application Model (SAM)

The Basics

AWS KMS is a Key Management Service that let you create Cryptographic keys that you can use to encrypt and decrypt data and also other keys. You can read more about it here.

Important points about Keys

Please note that the customer master keys(CMK) generated can only be used to encrypt small amount of data like passwords, RSA key. You can use AWS KMS CMKs to generate, encrypt, and decrypt data keys. However, AWS KMS does not store, manage, or track your data keys, or perform cryptographic operations with data keys.

You must use and manage data keys outside of AWS KMS. KMS API uses AWS KMS CMK in the encryption operations and they cannot accept more than 4 KB (4096 bytes) of data. To encrypt application data, use the server-side encryption features of an AWS service, or a client-side encryption library, such as the AWS Encryption SDK or the Amazon S3 encryption client.

Scenario

We want to create signup and login forms for a website.

Passwords should be encrypted and stored in DynamoDB database.

What do we need?

  1. KMS key to encrypt and decrypt data
  2. DynamoDB table to store password.
  3. Lambda functions & APIs to process Login and Sign up forms.
  4. Sign up/ Login forms in HTML.

Lets Implement it as Serverless Application Model (SAM)!

Lets first create the Key that we will use to encrypt and decrypt password.

KmsKey:
    Type: AWS::KMS::Key
    Properties: 
      Description: CMK for encrypting and decrypting
      KeyPolicy:
        Version: '2012-10-17'
        Id: key-default-1
        Statement:
        - Sid: Enable IAM User Permissions
          Effect: Allow
          Principal:
            AWS: !Sub arn:aws:iam::${AWS::AccountId}:root
          Action: kms:*
          Resource: '*'
        - Sid: Allow administration of the key
          Effect: Allow
          Principal:
            AWS: !Sub arn:aws:iam::${AWS::AccountId}:user/${KeyAdmin}
          Action:
          - kms:Create*
          - kms:Describe*
          - kms:Enable*
          - kms:List*
          - kms:Put*
          - kms:Update*
          - kms:Revoke*
          - kms:Disable*
          - kms:Get*
          - kms:Delete*
          - kms:ScheduleKeyDeletion
          - kms:CancelKeyDeletion
          Resource: '*'
        - Sid: Allow use of the key
          Effect: Allow
          Principal:
            AWS: !Sub arn:aws:iam::${AWS::AccountId}:user/${KeyUser}
          Action:
          - kms:DescribeKey
          - kms:Encrypt
          - kms:Decrypt
          - kms:ReEncrypt*
          - kms:GenerateDataKey
          - kms:GenerateDataKeyWithoutPlaintext
          Resource: '*'

The important thing in above snippet is the KeyPolicy. KMS requires a Key Administrator and Key User. As a best practice your Key Administrator and Key User should be 2 separate user in your Organisation. We are allowing all permissions to the root users.

So if your key Administrator leaves the organisation, the root user will be able to delete this key. As you can see **KeyAdmin **can manage the key but not use it and KeyUser can only use the key. ${KeyAdmin} and **${KeyUser} **are parameters in the SAM template.

You would be asked to provide values for these parameters during SAM Deploy.

#aws #serverless #aws-sam #aws-key-management-service #aws-certification #aws-api-gateway #tutorial-for-beginners #aws-blogs

How To Unite AWS KMS with Serverless Application Model (SAM)
Rory  West

Rory West

1619263860

Why Terraform? How to Getting Started with Terraform Using AWS

Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.

Traditional Infrastructure vs Modern Infrastructure

Traditional Infrastructure

  • Mutable
  • Operational Complexity
  • No Central Control on Infrastructure

Modern Infrastructure

  • Immutable
  • Less Operational Complexity
  • Faster time to the market
  • single point for state management

#terraform-aws #terraform #aws #aws-ec2

Why Terraform? How to Getting Started with Terraform Using AWS

How to easily create a HTTP 301 redirection with AWS API Gateway

Use Case

The use case is pretty explicit, every request you need to do a redirect.

I needed to do this because of a Gateway restriction where the root of a {proxy+} resource can’t be include in the {proxy+} itself

What I mean here is if you have the following structure

/docs won’t be included in the lambda targeted by the proxy. My suggestion is to simply create a 301 from /docs to /docs/index.html.

#terraform #aws-lambda #aws-api-gateway #http-redirect-301 #aws

How to easily create a HTTP 301 redirection with AWS API Gateway
Rory  West

Rory West

1620959460

Complete Guide to Terraform AWS

We’re continuing our series on Terraform AWS with a post that breaks down the basics. The world of Terraform AWS can be described as complex — from AWS storage to AWS best practices, there’s a depth of knowledge necessary to get familiar with Terraform AWS.

Whether you’re an expert at Terraform AWS or just getting started, it’s our goal at InfraCode to provide you with clear and easy-to-understand information at every level. The number of resources out there is abundant but overwhelming. That’s why we create simplified guides that are immediately usable and always understandable.

In this article, we’ll dive into:

  • A Beginner’s Overview to Terraform AWS
  • Managing AWS Storage
  • Terraform AWS Best Practices

#aws-ec2 #aws #terraform #terraform aws

Complete Guide to Terraform AWS