[{"data":1,"prerenderedAt":2377},["ShallowReactive",2],{"tag-aws":3},[4,426],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"date":11,"layout":12,"subtitle":13,"image":14,"optimized_image":14,"category":15,"tags":16,"author":19,"paginate":7,"body":20,"_type":420,"_id":421,"_source":422,"_file":423,"_stem":424,"_extension":425},"/posts/single-table-design","posts",false,"","Single Table Design","Exploring Java 17's New Features with examples","2023-12-27T11:00:00.000Z","post","A Practical Approach to Database Modeling with dynamoDb","/assets/img/uploads/cloud-computing.jpg","code",[15,17,18],"database","aws","jaimedearcos",{"type":21,"children":22,"toc":411},"root",[23,43,50,55,62,97,103,136,142,147,156,165,210,217,255,276,285,306,348,354,359,366,371,406],{"type":24,"tag":25,"props":26,"children":27},"element","blockquote",{},[28],{"type":24,"tag":29,"props":30,"children":31},"p",{},[32,35,41],{"type":33,"value":34},"text","In the realm of software development and database design, the ",{"type":24,"tag":36,"props":37,"children":38},"strong",{},[39],{"type":33,"value":40},"Single Table Design (STD)",{"type":33,"value":42}," has emerged as a compelling model for structuring data. This approach challenges traditional database normalization techniques by advocating for a simplified, denormalized structure contained within a single table. In this article, we will delve into the essence of Single Table Design, exploring its advantages and drawbacks, and provide a practical example to illustrate its application.",{"type":24,"tag":44,"props":45,"children":47},"h2",{"id":46},"what-is-single-table-design",[48],{"type":33,"value":49},"What is Single Table Design?",{"type":24,"tag":29,"props":51,"children":52},{},[53],{"type":33,"value":54},"Single Table Design is a database modeling strategy that involves consolidating multiple entities and relationships into a single table. Unlike the conventional normalization process, which divides data into separate tables to minimize redundancy and maintain referential integrity, STD embraces a more denormalized structure. This means that a single table contains all the necessary fields and relationships to represent various entities within the system.",{"type":24,"tag":56,"props":57,"children":59},"h3",{"id":58},"advantages-of-single-table-design",[60],{"type":33,"value":61},"Advantages of Single Table Design",{"type":24,"tag":63,"props":64,"children":65},"ul",{},[66,77,87],{"type":24,"tag":67,"props":68,"children":69},"li",{},[70,75],{"type":24,"tag":36,"props":71,"children":72},{},[73],{"type":33,"value":74},"Simplified Schema:",{"type":33,"value":76}," STD simplifies the database schema by eliminating the need for multiple tables and complex relationships. This can lead to easier maintenance and a more straightforward understanding of the data structure.",{"type":24,"tag":67,"props":78,"children":79},{},[80,85],{"type":24,"tag":36,"props":81,"children":82},{},[83],{"type":33,"value":84},"Improved Query Performance:",{"type":33,"value":86}," Retrieving data from a single table can often be more efficient than joining multiple tables, especially for read-heavy operations. This can result in better query performance and reduced latency.",{"type":24,"tag":67,"props":88,"children":89},{},[90,95],{"type":24,"tag":36,"props":91,"children":92},{},[93],{"type":33,"value":94},"Flexibility in Schema Evolution:",{"type":33,"value":96}," With a denormalized structure, it becomes easier to adapt the database schema to evolving requirements without the need for complex migrations. Adding or modifying fields becomes a less cumbersome task.",{"type":24,"tag":56,"props":98,"children":100},{"id":99},"disadvantages-of-single-table-design",[101],{"type":33,"value":102},"Disadvantages of Single Table Design",{"type":24,"tag":63,"props":104,"children":105},{},[106,116,126],{"type":24,"tag":67,"props":107,"children":108},{},[109,114],{"type":24,"tag":36,"props":110,"children":111},{},[112],{"type":33,"value":113},"Data Redundancy:",{"type":33,"value":115}," Since data is denormalized, there may be redundancy in the storage of information. This can lead to increased storage requirements and potential inconsistencies if updates are not managed properly.",{"type":24,"tag":67,"props":117,"children":118},{},[119,124],{"type":24,"tag":36,"props":120,"children":121},{},[122],{"type":33,"value":123},"Limited Support for Complex Relationships:",{"type":33,"value":125}," STD might not be suitable for systems with complex relationships between entities. Maintaining intricate connections between data points could become challenging in a denormalized structure.",{"type":24,"tag":67,"props":127,"children":128},{},[129,134],{"type":24,"tag":36,"props":130,"children":131},{},[132],{"type":33,"value":133},"Normalization Benefits Sacrificed:",{"type":33,"value":135}," By consolidating data into a single table, the benefits of normalization, such as minimizing data redundancy and ensuring consistency, are sacrificed to some extent.",{"type":24,"tag":44,"props":137,"children":139},{"id":138},"example-of-single-table-design",[140],{"type":33,"value":141},"Example of Single Table Design",{"type":24,"tag":29,"props":143,"children":144},{},[145],{"type":33,"value":146},"Let's consider a simplified example of a blog application where we have Users, Posts, and Comments as entities. In a traditional normalized database, we might have separate tables for each entity. However, in a Single Table Design approach, we would merge these entities into a single table:",{"type":24,"tag":148,"props":149,"children":151},"pre",{"code":150},"| PK           | SK            | GSI1PK   | GSI1SK     | Attribute1    | Attribute2      | ... |\n|--------------|---------------|----------|------------|---------------|-----------------|-----|\n| USER#1       | PROFILE#1     |          |            | Alice         | alice@email.com | ... |\n| ORDER#1      | INFO#1        | USER#1   | PROFILE#1  |               |                 | ... |\n| PRODUCT#123  | DETAILS#123   |          |            | Laptop        | Electronics     | ... |\n| COMMENT#101  | TEXT#101      | USER#1   | ORDER#1    | Great post!   |                 | ... |\n",[152],{"type":24,"tag":15,"props":153,"children":154},{"__ignoreMap":8},[155],{"type":33,"value":150},{"type":24,"tag":29,"props":157,"children":158},{},[159],{"type":24,"tag":160,"props":161,"children":162},"em",{},[163],{"type":33,"value":164},"Explanation:",{"type":24,"tag":63,"props":166,"children":167},{},[168,189],{"type":24,"tag":67,"props":169,"children":170},{},[171,176],{"type":24,"tag":36,"props":172,"children":173},{},[174],{"type":33,"value":175},"PK (Partition Key) and SK (Sort Key):",{"type":24,"tag":63,"props":177,"children":178},{},[179,184],{"type":24,"tag":67,"props":180,"children":181},{},[182],{"type":33,"value":183},"USER#1, ORDER#1, PRODUCT#123, and COMMENT#101 serve as the PK, representing distinct entities (User, Order, Product, Comment).",{"type":24,"tag":67,"props":185,"children":186},{},[187],{"type":33,"value":188},"PROFILE#1, INFO#1, DETAILS#123, and TEXT#101 act as SK, helping to distinguish and organize items within the same PK.",{"type":24,"tag":67,"props":190,"children":191},{},[192,197],{"type":24,"tag":36,"props":193,"children":194},{},[195],{"type":33,"value":196},"GSI1PK and GSI1SK (Global Secondary Index):",{"type":24,"tag":63,"props":198,"children":199},{},[200,205],{"type":24,"tag":67,"props":201,"children":202},{},[203],{"type":33,"value":204},"GSI1PK and GSI1SK are additional indices that facilitate different access patterns.",{"type":24,"tag":67,"props":206,"children":207},{},[208],{"type":33,"value":209},"For example, GSI1PK USER#1 and GSI1SK PROFILE#1 enable efficient querying for user profiles.",{"type":24,"tag":211,"props":212,"children":214},"h4",{"id":213},"query-examples",[215],{"type":33,"value":216},"Query Examples:",{"type":24,"tag":218,"props":219,"children":220},"ol",{},[221,250],{"type":24,"tag":67,"props":222,"children":223},{},[224,226],{"type":33,"value":225},"Retrieve User Profile:\n",{"type":24,"tag":63,"props":227,"children":228},{},[229],{"type":24,"tag":67,"props":230,"children":231},{},[232,234,240,242,248],{"type":33,"value":233},"Query using PK ",{"type":24,"tag":15,"props":235,"children":237},{"className":236},[],[238],{"type":33,"value":239},"USER#1",{"type":33,"value":241}," and SK ",{"type":24,"tag":15,"props":243,"children":245},{"className":244},[],[246],{"type":33,"value":247},"PROFILE#1",{"type":33,"value":249},".",{"type":24,"tag":67,"props":251,"children":252},{},[253],{"type":33,"value":254},"Fetch Orders for a User:",{"type":24,"tag":63,"props":256,"children":257},{},[258],{"type":24,"tag":67,"props":259,"children":260},{},[261,262,267,269,275],{"type":33,"value":233},{"type":24,"tag":15,"props":263,"children":265},{"className":264},[],[266],{"type":33,"value":239},{"type":33,"value":268}," and SK range ",{"type":24,"tag":15,"props":270,"children":272},{"className":271},[],[273],{"type":33,"value":274},"INFO#",{"type":33,"value":249},{"type":24,"tag":218,"props":277,"children":279},{"start":278},3,[280],{"type":24,"tag":67,"props":281,"children":282},{},[283],{"type":33,"value":284},"Get Comments for an Order:",{"type":24,"tag":63,"props":286,"children":287},{},[288],{"type":24,"tag":67,"props":289,"children":290},{},[291,292,298,299,305],{"type":33,"value":233},{"type":24,"tag":15,"props":293,"children":295},{"className":294},[],[296],{"type":33,"value":297},"ORDER#1",{"type":33,"value":268},{"type":24,"tag":15,"props":300,"children":302},{"className":301},[],[303],{"type":33,"value":304},"TEXT#",{"type":33,"value":249},{"type":24,"tag":29,"props":307,"children":308},{},[309,311,315,317,322,324,330,332,338,340,346],{"type":33,"value":310},"This example demonstrates how ",{"type":24,"tag":36,"props":312,"children":313},{},[314],{"type":33,"value":9},{"type":33,"value":316}," in ",{"type":24,"tag":36,"props":318,"children":319},{},[320],{"type":33,"value":321},"DynamoDB",{"type":33,"value":323},", utilizing ",{"type":24,"tag":15,"props":325,"children":327},{"className":326},[],[328],{"type":33,"value":329},"PK",{"type":33,"value":331},", ",{"type":24,"tag":15,"props":333,"children":335},{"className":334},[],[336],{"type":33,"value":337},"SK",{"type":33,"value":339},", and ",{"type":24,"tag":15,"props":341,"children":343},{"className":342},[],[344],{"type":33,"value":345},"GSI",{"type":33,"value":347},", can efficiently handle diverse queries within a unified structure. It optimizes data retrieval while adhering to the principles of denormalization and simplicity.",{"type":24,"tag":44,"props":349,"children":351},{"id":350},"conclusion",[352],{"type":33,"value":353},"Conclusion",{"type":24,"tag":29,"props":355,"children":356},{},[357],{"type":33,"value":358},"Single Table Design offers a practical alternative to traditional database normalization, emphasizing simplicity and performance. While it may not be suitable for every use case, especially those with complex relationships, STD can be a powerful tool in scenarios where a denormalized structure aligns with the application's requirements. Consider the specific needs of your project and evaluate whether Single Table Design is a suitable fit for your database modeling approach.",{"type":24,"tag":360,"props":361,"children":363},"h1",{"id":362},"further-reading",[364],{"type":33,"value":365},"Further Reading",{"type":24,"tag":29,"props":367,"children":368},{},[369],{"type":33,"value":370},"To deepen your understanding of Single Table Design in Amazon DynamoDB and database modeling best practices, consider exploring the following official AWS documentation:",{"type":24,"tag":63,"props":372,"children":373},{},[374,386,396],{"type":24,"tag":67,"props":375,"children":376},{},[377],{"type":24,"tag":378,"props":379,"children":383},"a",{"href":380,"rel":381},"https://aws.amazon.com/es/pm/dynamodb/",[382],"nofollow",[384],{"type":33,"value":385},"DynamoDB Overview",{"type":24,"tag":67,"props":387,"children":388},{},[389],{"type":24,"tag":378,"props":390,"children":393},{"href":391,"rel":392},"https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/best-practices.html",[382],[394],{"type":33,"value":395},"Best practices for designing and architecting with DynamoDB",{"type":24,"tag":67,"props":397,"children":398},{},[399],{"type":24,"tag":378,"props":400,"children":403},{"href":401,"rel":402},"https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/examples-dynamodb.html",[382],[404],{"type":33,"value":405},"DynamoDB Examples Using the AWS SDK for Java",{"type":24,"tag":29,"props":407,"children":408},{},[409],{"type":33,"value":410},"These resources provide comprehensive insights into the principles, features, and best practices related to DynamoDB, including Single Table Design. Referencing the official documentation will empower you with the knowledge needed to effectively design, implement, and optimize your database models on the AWS platform.",{"title":8,"searchDepth":412,"depth":412,"links":413},2,[414,418,419],{"id":46,"depth":412,"text":49,"children":415},[416,417],{"id":58,"depth":278,"text":61},{"id":99,"depth":278,"text":102},{"id":138,"depth":412,"text":141},{"id":350,"depth":412,"text":353},"markdown","content:posts:single-table-design.md","content","posts/single-table-design.md","posts/single-table-design","md",{"_path":427,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":428,"description":429,"date":430,"layout":12,"subtitle":429,"image":431,"optimized_image":431,"category":432,"tags":433,"author":19,"paginate":7,"body":436,"_type":420,"_id":2374,"_source":422,"_file":2375,"_stem":2376,"_extension":425},"/posts/manage-aws-infrastructure-with-terraform","Bootstrap complete Java application infrastructure in AWS with Terraform","How to bootstrap a Java + MySql application infrastructure with terraform","2020-12-02T11:00:00.000Z","/assets/img/uploads/infrastructure.jpg","infrastructure",[434,18,435],"terraform","java",{"type":21,"children":437,"toc":2367},[438,448,454,459,469,475,480,513,518,953,959,964,1386,1392,1404,2298,2304,2309,2343,2361],{"type":24,"tag":29,"props":439,"children":440},{},[441,446],{"type":24,"tag":36,"props":442,"children":443},{},[444],{"type":33,"value":445},"Terraform",{"type":33,"value":447}," provides a way of describe infrastructure as code. Terraform will manage the communication with the\ninfrastructure provider (Amazon AWS in this example) to create, update or delete infrastructure resources.",{"type":24,"tag":44,"props":449,"children":451},{"id":450},"bootstrap-elasticbeanstalk-rds-mysql-application",[452],{"type":33,"value":453},"Bootstrap ElasticBeanstalk + RDS MySql application",{"type":24,"tag":29,"props":455,"children":456},{},[457],{"type":33,"value":458},"In the following example we are going to bootstrap the necessary infrastructure to serve a Java API connected to RDS\nMySql database.",{"type":24,"tag":29,"props":460,"children":461},{},[462],{"type":24,"tag":463,"props":464,"children":468},"img",{"alt":465,"src":466,"title":467},"aws infrastructure diagram","/assets/img/uploads/terraform-basic.png","Aws infrastructure diagram",[],{"type":24,"tag":44,"props":470,"children":472},{"id":471},"step-1-networking",[473],{"type":33,"value":474},"Step 1 - Networking",{"type":24,"tag":29,"props":476,"children":477},{},[478],{"type":33,"value":479},"We are going to create a terraform module for VPC and other networking resources:",{"type":24,"tag":63,"props":481,"children":482},{},[483,493,503],{"type":24,"tag":67,"props":484,"children":485},{},[486,491],{"type":24,"tag":36,"props":487,"children":488},{},[489],{"type":33,"value":490},"VPC",{"type":33,"value":492}," - Virtual Private Cloud: Is a logical group of resources that are isolated from other VPCs and other customers\nof the Public Cloud.",{"type":24,"tag":67,"props":494,"children":495},{},[496,501],{"type":24,"tag":36,"props":497,"children":498},{},[499],{"type":33,"value":500},"VPC Subnet",{"type":33,"value":502}," : A VPC Subnet is defined by a subrange of the network IP addresses assigned to the VPC.",{"type":24,"tag":67,"props":504,"children":505},{},[506,511],{"type":24,"tag":36,"props":507,"children":508},{},[509],{"type":33,"value":510},"Security Group",{"type":33,"value":512}," : The VPC Security Groups are the way AWS implements firewalls between instances in the VPC.\nIn a VPC all inbound and outbound network traffic is denied by default. In order to allow traffic, a security group\nis defined and rules are assigned to the Security Group.",{"type":24,"tag":29,"props":514,"children":515},{},[516],{"type":33,"value":517},"The following is a terraform module to group all the needed networking resources in just one file.",{"type":24,"tag":148,"props":519,"children":523},{"className":520,"code":521,"language":522,"meta":8,"style":8},"language-ruby shiki shiki-themes github-dark github-light","resource \"aws_vpc\" \"_\" {\n  cidr_block = var.vpc_cidr\n  enable_dns_support   = var.enable_dns_support\n  enable_dns_hostnames = var.enable_dns_hostnames\n  tags = {\n    Name = \"${var.app-name}-vpc\"\n  }\n}\n\nresource \"aws_internet_gateway\" \"gateway\" {\n  vpc_id = aws_vpc._.id\n  tags = {\n    Name = \"${var.app-name}-gateway\"\n  }\n}\n\nresource \"aws_route_table\" \"route_table\" {\n  vpc_id = aws_vpc._.id\n\n  dynamic \"route\" {\n    for_each = var.routes\n\n    content {\n      cidr_block     = route.value.cidr_block\n      gateway_id     = aws_internet_gateway.gateway.id\n      instance_id    = route.value.instance_id\n      nat_gateway_id = route.value.nat_gateway_id\n    }\n  }\n  tags = {\n    Name = \"${var.app-name}-route-table\"\n  }\n}\nresource \"aws_subnet\" \"subnet-a\" {\n  vpc_id                  = aws_vpc._.id\n  cidr_block              = \"10.0.32.0/20\"\n  availability_zone       = \"${var.region}a\"\n  map_public_ip_on_launch = true\n  tags = {\n    Name = \"${var.app-name}-subnet-a\"\n  }\n}\n \noutput \"_\" {\n  value = {\n    vpc_id = aws_vpc._.id\n    subnet_a = aws_subnet.subnet-a.id \n  }\n}\n","ruby",[524],{"type":24,"tag":15,"props":525,"children":526},{"__ignoreMap":8},[527,538,546,554,563,572,581,590,599,609,618,627,635,644,652,660,668,677,685,693,702,711,719,728,737,746,755,764,773,781,789,798,806,814,823,832,841,850,859,867,876,884,892,901,910,919,928,937,945],{"type":24,"tag":528,"props":529,"children":532},"span",{"class":530,"line":531},"line",1,[533],{"type":24,"tag":528,"props":534,"children":535},{},[536],{"type":33,"value":537},"resource \"aws_vpc\" \"_\" {\n",{"type":24,"tag":528,"props":539,"children":540},{"class":530,"line":412},[541],{"type":24,"tag":528,"props":542,"children":543},{},[544],{"type":33,"value":545},"  cidr_block = var.vpc_cidr\n",{"type":24,"tag":528,"props":547,"children":548},{"class":530,"line":278},[549],{"type":24,"tag":528,"props":550,"children":551},{},[552],{"type":33,"value":553},"  enable_dns_support   = var.enable_dns_support\n",{"type":24,"tag":528,"props":555,"children":557},{"class":530,"line":556},4,[558],{"type":24,"tag":528,"props":559,"children":560},{},[561],{"type":33,"value":562},"  enable_dns_hostnames = var.enable_dns_hostnames\n",{"type":24,"tag":528,"props":564,"children":566},{"class":530,"line":565},5,[567],{"type":24,"tag":528,"props":568,"children":569},{},[570],{"type":33,"value":571},"  tags = {\n",{"type":24,"tag":528,"props":573,"children":575},{"class":530,"line":574},6,[576],{"type":24,"tag":528,"props":577,"children":578},{},[579],{"type":33,"value":580},"    Name = \"${var.app-name}-vpc\"\n",{"type":24,"tag":528,"props":582,"children":584},{"class":530,"line":583},7,[585],{"type":24,"tag":528,"props":586,"children":587},{},[588],{"type":33,"value":589},"  }\n",{"type":24,"tag":528,"props":591,"children":593},{"class":530,"line":592},8,[594],{"type":24,"tag":528,"props":595,"children":596},{},[597],{"type":33,"value":598},"}\n",{"type":24,"tag":528,"props":600,"children":602},{"class":530,"line":601},9,[603],{"type":24,"tag":528,"props":604,"children":606},{"emptyLinePlaceholder":605},true,[607],{"type":33,"value":608},"\n",{"type":24,"tag":528,"props":610,"children":612},{"class":530,"line":611},10,[613],{"type":24,"tag":528,"props":614,"children":615},{},[616],{"type":33,"value":617},"resource \"aws_internet_gateway\" \"gateway\" {\n",{"type":24,"tag":528,"props":619,"children":621},{"class":530,"line":620},11,[622],{"type":24,"tag":528,"props":623,"children":624},{},[625],{"type":33,"value":626},"  vpc_id = aws_vpc._.id\n",{"type":24,"tag":528,"props":628,"children":630},{"class":530,"line":629},12,[631],{"type":24,"tag":528,"props":632,"children":633},{},[634],{"type":33,"value":571},{"type":24,"tag":528,"props":636,"children":638},{"class":530,"line":637},13,[639],{"type":24,"tag":528,"props":640,"children":641},{},[642],{"type":33,"value":643},"    Name = \"${var.app-name}-gateway\"\n",{"type":24,"tag":528,"props":645,"children":647},{"class":530,"line":646},14,[648],{"type":24,"tag":528,"props":649,"children":650},{},[651],{"type":33,"value":589},{"type":24,"tag":528,"props":653,"children":655},{"class":530,"line":654},15,[656],{"type":24,"tag":528,"props":657,"children":658},{},[659],{"type":33,"value":598},{"type":24,"tag":528,"props":661,"children":663},{"class":530,"line":662},16,[664],{"type":24,"tag":528,"props":665,"children":666},{"emptyLinePlaceholder":605},[667],{"type":33,"value":608},{"type":24,"tag":528,"props":669,"children":671},{"class":530,"line":670},17,[672],{"type":24,"tag":528,"props":673,"children":674},{},[675],{"type":33,"value":676},"resource \"aws_route_table\" \"route_table\" {\n",{"type":24,"tag":528,"props":678,"children":680},{"class":530,"line":679},18,[681],{"type":24,"tag":528,"props":682,"children":683},{},[684],{"type":33,"value":626},{"type":24,"tag":528,"props":686,"children":688},{"class":530,"line":687},19,[689],{"type":24,"tag":528,"props":690,"children":691},{"emptyLinePlaceholder":605},[692],{"type":33,"value":608},{"type":24,"tag":528,"props":694,"children":696},{"class":530,"line":695},20,[697],{"type":24,"tag":528,"props":698,"children":699},{},[700],{"type":33,"value":701},"  dynamic \"route\" {\n",{"type":24,"tag":528,"props":703,"children":705},{"class":530,"line":704},21,[706],{"type":24,"tag":528,"props":707,"children":708},{},[709],{"type":33,"value":710},"    for_each = var.routes\n",{"type":24,"tag":528,"props":712,"children":714},{"class":530,"line":713},22,[715],{"type":24,"tag":528,"props":716,"children":717},{"emptyLinePlaceholder":605},[718],{"type":33,"value":608},{"type":24,"tag":528,"props":720,"children":722},{"class":530,"line":721},23,[723],{"type":24,"tag":528,"props":724,"children":725},{},[726],{"type":33,"value":727},"    content {\n",{"type":24,"tag":528,"props":729,"children":731},{"class":530,"line":730},24,[732],{"type":24,"tag":528,"props":733,"children":734},{},[735],{"type":33,"value":736},"      cidr_block     = route.value.cidr_block\n",{"type":24,"tag":528,"props":738,"children":740},{"class":530,"line":739},25,[741],{"type":24,"tag":528,"props":742,"children":743},{},[744],{"type":33,"value":745},"      gateway_id     = aws_internet_gateway.gateway.id\n",{"type":24,"tag":528,"props":747,"children":749},{"class":530,"line":748},26,[750],{"type":24,"tag":528,"props":751,"children":752},{},[753],{"type":33,"value":754},"      instance_id    = route.value.instance_id\n",{"type":24,"tag":528,"props":756,"children":758},{"class":530,"line":757},27,[759],{"type":24,"tag":528,"props":760,"children":761},{},[762],{"type":33,"value":763},"      nat_gateway_id = route.value.nat_gateway_id\n",{"type":24,"tag":528,"props":765,"children":767},{"class":530,"line":766},28,[768],{"type":24,"tag":528,"props":769,"children":770},{},[771],{"type":33,"value":772},"    }\n",{"type":24,"tag":528,"props":774,"children":776},{"class":530,"line":775},29,[777],{"type":24,"tag":528,"props":778,"children":779},{},[780],{"type":33,"value":589},{"type":24,"tag":528,"props":782,"children":784},{"class":530,"line":783},30,[785],{"type":24,"tag":528,"props":786,"children":787},{},[788],{"type":33,"value":571},{"type":24,"tag":528,"props":790,"children":792},{"class":530,"line":791},31,[793],{"type":24,"tag":528,"props":794,"children":795},{},[796],{"type":33,"value":797},"    Name = \"${var.app-name}-route-table\"\n",{"type":24,"tag":528,"props":799,"children":801},{"class":530,"line":800},32,[802],{"type":24,"tag":528,"props":803,"children":804},{},[805],{"type":33,"value":589},{"type":24,"tag":528,"props":807,"children":809},{"class":530,"line":808},33,[810],{"type":24,"tag":528,"props":811,"children":812},{},[813],{"type":33,"value":598},{"type":24,"tag":528,"props":815,"children":817},{"class":530,"line":816},34,[818],{"type":24,"tag":528,"props":819,"children":820},{},[821],{"type":33,"value":822},"resource \"aws_subnet\" \"subnet-a\" {\n",{"type":24,"tag":528,"props":824,"children":826},{"class":530,"line":825},35,[827],{"type":24,"tag":528,"props":828,"children":829},{},[830],{"type":33,"value":831},"  vpc_id                  = aws_vpc._.id\n",{"type":24,"tag":528,"props":833,"children":835},{"class":530,"line":834},36,[836],{"type":24,"tag":528,"props":837,"children":838},{},[839],{"type":33,"value":840},"  cidr_block              = \"10.0.32.0/20\"\n",{"type":24,"tag":528,"props":842,"children":844},{"class":530,"line":843},37,[845],{"type":24,"tag":528,"props":846,"children":847},{},[848],{"type":33,"value":849},"  availability_zone       = \"${var.region}a\"\n",{"type":24,"tag":528,"props":851,"children":853},{"class":530,"line":852},38,[854],{"type":24,"tag":528,"props":855,"children":856},{},[857],{"type":33,"value":858},"  map_public_ip_on_launch = true\n",{"type":24,"tag":528,"props":860,"children":862},{"class":530,"line":861},39,[863],{"type":24,"tag":528,"props":864,"children":865},{},[866],{"type":33,"value":571},{"type":24,"tag":528,"props":868,"children":870},{"class":530,"line":869},40,[871],{"type":24,"tag":528,"props":872,"children":873},{},[874],{"type":33,"value":875},"    Name = \"${var.app-name}-subnet-a\"\n",{"type":24,"tag":528,"props":877,"children":879},{"class":530,"line":878},41,[880],{"type":24,"tag":528,"props":881,"children":882},{},[883],{"type":33,"value":589},{"type":24,"tag":528,"props":885,"children":887},{"class":530,"line":886},42,[888],{"type":24,"tag":528,"props":889,"children":890},{},[891],{"type":33,"value":598},{"type":24,"tag":528,"props":893,"children":895},{"class":530,"line":894},43,[896],{"type":24,"tag":528,"props":897,"children":898},{},[899],{"type":33,"value":900}," \n",{"type":24,"tag":528,"props":902,"children":904},{"class":530,"line":903},44,[905],{"type":24,"tag":528,"props":906,"children":907},{},[908],{"type":33,"value":909},"output \"_\" {\n",{"type":24,"tag":528,"props":911,"children":913},{"class":530,"line":912},45,[914],{"type":24,"tag":528,"props":915,"children":916},{},[917],{"type":33,"value":918},"  value = {\n",{"type":24,"tag":528,"props":920,"children":922},{"class":530,"line":921},46,[923],{"type":24,"tag":528,"props":924,"children":925},{},[926],{"type":33,"value":927},"    vpc_id = aws_vpc._.id\n",{"type":24,"tag":528,"props":929,"children":931},{"class":530,"line":930},47,[932],{"type":24,"tag":528,"props":933,"children":934},{},[935],{"type":33,"value":936},"    subnet_a = aws_subnet.subnet-a.id \n",{"type":24,"tag":528,"props":938,"children":940},{"class":530,"line":939},48,[941],{"type":24,"tag":528,"props":942,"children":943},{},[944],{"type":33,"value":589},{"type":24,"tag":528,"props":946,"children":948},{"class":530,"line":947},49,[949],{"type":24,"tag":528,"props":950,"children":951},{},[952],{"type":33,"value":598},{"type":24,"tag":44,"props":954,"children":956},{"id":955},"step-2-rds-mysql-database",[957],{"type":33,"value":958},"Step 2 - RDS MySql database",{"type":24,"tag":29,"props":960,"children":961},{},[962],{"type":33,"value":963},"Now we need to define the RDS Database with the corresponding security group, note that RDS security group has a reference\nto another security group, this will allow ingress traffic from elastic beanstalk instance to the database.",{"type":24,"tag":148,"props":965,"children":967},{"className":520,"code":966,"language":522,"meta":8,"style":8},"resource \"aws_security_group\" \"rds-sg\" {\n\n  name = \"rds-sg\"\n  description = \"RDS (terraform-managed)\"\n  vpc_id = module.vpc._.vpc_id\n\n  # Only MySQL port in for elastic beanstalk instance\n  ingress {\n    from_port       = var.rds-port\n    to_port         = var.rds-port\n    protocol        = \"tcp\"\n    security_groups = [aws_security_group.eb-sg.id]\n  }\n  # Allow all outbound traffic.\n  egress {\n    from_port   = 0\n    to_port     = 0\n    protocol    = \"-1\"\n    cidr_blocks = [\"0.0.0.0/0\"]\n  }\n  tags = {\n    Name = \"RDS_sg\"\n  }\n}\n\nresource \"aws_db_instance\" \"rds-db\" {\n\n  name                    = var.rds-schema\n  identifier              = var.rds-identifier\n\n  allocated_storage       = 20\n  backup_retention_period = 7\n  backup_window           = \"10:46-11:16\"\n  maintenance_window      = \"Mon:00:00-Mon:03:00\"\n  engine                  = \"mysql\"\n  engine_version          = \"8.0.15\"\n  instance_class          = \"db.t2.micro\"\n  username                = var.rds-username\n  password                = var.rds-password\n  port                    = var.rds-port\n  publicly_accessible     = true\n  storage_type            = \"gp2\"\n\n  allow_major_version_upgrade  = false\n  auto_minor_version_upgrade   = true\n  performance_insights_enabled = false\n  skip_final_snapshot          = true\n  final_snapshot_identifier = \"database-${var.rds-schema}-snapshot\"\n\n  vpc_security_group_ids = [aws_security_group.rds-sg.id]\n  availability_zone         = var.rds-availability_zone\n  multi_az                  = var.rds-multi_az \n}\n",[968],{"type":24,"tag":15,"props":969,"children":970},{"__ignoreMap":8},[971,979,986,994,1002,1010,1017,1025,1033,1041,1049,1057,1065,1072,1080,1088,1096,1104,1112,1120,1127,1134,1142,1149,1156,1163,1171,1178,1186,1194,1201,1209,1217,1225,1233,1241,1249,1257,1265,1273,1281,1289,1297,1304,1312,1320,1328,1336,1344,1351,1360,1369,1378],{"type":24,"tag":528,"props":972,"children":973},{"class":530,"line":531},[974],{"type":24,"tag":528,"props":975,"children":976},{},[977],{"type":33,"value":978},"resource \"aws_security_group\" \"rds-sg\" {\n",{"type":24,"tag":528,"props":980,"children":981},{"class":530,"line":412},[982],{"type":24,"tag":528,"props":983,"children":984},{"emptyLinePlaceholder":605},[985],{"type":33,"value":608},{"type":24,"tag":528,"props":987,"children":988},{"class":530,"line":278},[989],{"type":24,"tag":528,"props":990,"children":991},{},[992],{"type":33,"value":993},"  name = \"rds-sg\"\n",{"type":24,"tag":528,"props":995,"children":996},{"class":530,"line":556},[997],{"type":24,"tag":528,"props":998,"children":999},{},[1000],{"type":33,"value":1001},"  description = \"RDS (terraform-managed)\"\n",{"type":24,"tag":528,"props":1003,"children":1004},{"class":530,"line":565},[1005],{"type":24,"tag":528,"props":1006,"children":1007},{},[1008],{"type":33,"value":1009},"  vpc_id = module.vpc._.vpc_id\n",{"type":24,"tag":528,"props":1011,"children":1012},{"class":530,"line":574},[1013],{"type":24,"tag":528,"props":1014,"children":1015},{"emptyLinePlaceholder":605},[1016],{"type":33,"value":608},{"type":24,"tag":528,"props":1018,"children":1019},{"class":530,"line":583},[1020],{"type":24,"tag":528,"props":1021,"children":1022},{},[1023],{"type":33,"value":1024},"  # Only MySQL port in for elastic beanstalk instance\n",{"type":24,"tag":528,"props":1026,"children":1027},{"class":530,"line":592},[1028],{"type":24,"tag":528,"props":1029,"children":1030},{},[1031],{"type":33,"value":1032},"  ingress {\n",{"type":24,"tag":528,"props":1034,"children":1035},{"class":530,"line":601},[1036],{"type":24,"tag":528,"props":1037,"children":1038},{},[1039],{"type":33,"value":1040},"    from_port       = var.rds-port\n",{"type":24,"tag":528,"props":1042,"children":1043},{"class":530,"line":611},[1044],{"type":24,"tag":528,"props":1045,"children":1046},{},[1047],{"type":33,"value":1048},"    to_port         = var.rds-port\n",{"type":24,"tag":528,"props":1050,"children":1051},{"class":530,"line":620},[1052],{"type":24,"tag":528,"props":1053,"children":1054},{},[1055],{"type":33,"value":1056},"    protocol        = \"tcp\"\n",{"type":24,"tag":528,"props":1058,"children":1059},{"class":530,"line":629},[1060],{"type":24,"tag":528,"props":1061,"children":1062},{},[1063],{"type":33,"value":1064},"    security_groups = [aws_security_group.eb-sg.id]\n",{"type":24,"tag":528,"props":1066,"children":1067},{"class":530,"line":637},[1068],{"type":24,"tag":528,"props":1069,"children":1070},{},[1071],{"type":33,"value":589},{"type":24,"tag":528,"props":1073,"children":1074},{"class":530,"line":646},[1075],{"type":24,"tag":528,"props":1076,"children":1077},{},[1078],{"type":33,"value":1079},"  # Allow all outbound traffic.\n",{"type":24,"tag":528,"props":1081,"children":1082},{"class":530,"line":654},[1083],{"type":24,"tag":528,"props":1084,"children":1085},{},[1086],{"type":33,"value":1087},"  egress {\n",{"type":24,"tag":528,"props":1089,"children":1090},{"class":530,"line":662},[1091],{"type":24,"tag":528,"props":1092,"children":1093},{},[1094],{"type":33,"value":1095},"    from_port   = 0\n",{"type":24,"tag":528,"props":1097,"children":1098},{"class":530,"line":670},[1099],{"type":24,"tag":528,"props":1100,"children":1101},{},[1102],{"type":33,"value":1103},"    to_port     = 0\n",{"type":24,"tag":528,"props":1105,"children":1106},{"class":530,"line":679},[1107],{"type":24,"tag":528,"props":1108,"children":1109},{},[1110],{"type":33,"value":1111},"    protocol    = \"-1\"\n",{"type":24,"tag":528,"props":1113,"children":1114},{"class":530,"line":687},[1115],{"type":24,"tag":528,"props":1116,"children":1117},{},[1118],{"type":33,"value":1119},"    cidr_blocks = [\"0.0.0.0/0\"]\n",{"type":24,"tag":528,"props":1121,"children":1122},{"class":530,"line":695},[1123],{"type":24,"tag":528,"props":1124,"children":1125},{},[1126],{"type":33,"value":589},{"type":24,"tag":528,"props":1128,"children":1129},{"class":530,"line":704},[1130],{"type":24,"tag":528,"props":1131,"children":1132},{},[1133],{"type":33,"value":571},{"type":24,"tag":528,"props":1135,"children":1136},{"class":530,"line":713},[1137],{"type":24,"tag":528,"props":1138,"children":1139},{},[1140],{"type":33,"value":1141},"    Name = \"RDS_sg\"\n",{"type":24,"tag":528,"props":1143,"children":1144},{"class":530,"line":721},[1145],{"type":24,"tag":528,"props":1146,"children":1147},{},[1148],{"type":33,"value":589},{"type":24,"tag":528,"props":1150,"children":1151},{"class":530,"line":730},[1152],{"type":24,"tag":528,"props":1153,"children":1154},{},[1155],{"type":33,"value":598},{"type":24,"tag":528,"props":1157,"children":1158},{"class":530,"line":739},[1159],{"type":24,"tag":528,"props":1160,"children":1161},{"emptyLinePlaceholder":605},[1162],{"type":33,"value":608},{"type":24,"tag":528,"props":1164,"children":1165},{"class":530,"line":748},[1166],{"type":24,"tag":528,"props":1167,"children":1168},{},[1169],{"type":33,"value":1170},"resource \"aws_db_instance\" \"rds-db\" {\n",{"type":24,"tag":528,"props":1172,"children":1173},{"class":530,"line":757},[1174],{"type":24,"tag":528,"props":1175,"children":1176},{"emptyLinePlaceholder":605},[1177],{"type":33,"value":608},{"type":24,"tag":528,"props":1179,"children":1180},{"class":530,"line":766},[1181],{"type":24,"tag":528,"props":1182,"children":1183},{},[1184],{"type":33,"value":1185},"  name                    = var.rds-schema\n",{"type":24,"tag":528,"props":1187,"children":1188},{"class":530,"line":775},[1189],{"type":24,"tag":528,"props":1190,"children":1191},{},[1192],{"type":33,"value":1193},"  identifier              = var.rds-identifier\n",{"type":24,"tag":528,"props":1195,"children":1196},{"class":530,"line":783},[1197],{"type":24,"tag":528,"props":1198,"children":1199},{"emptyLinePlaceholder":605},[1200],{"type":33,"value":608},{"type":24,"tag":528,"props":1202,"children":1203},{"class":530,"line":791},[1204],{"type":24,"tag":528,"props":1205,"children":1206},{},[1207],{"type":33,"value":1208},"  allocated_storage       = 20\n",{"type":24,"tag":528,"props":1210,"children":1211},{"class":530,"line":800},[1212],{"type":24,"tag":528,"props":1213,"children":1214},{},[1215],{"type":33,"value":1216},"  backup_retention_period = 7\n",{"type":24,"tag":528,"props":1218,"children":1219},{"class":530,"line":808},[1220],{"type":24,"tag":528,"props":1221,"children":1222},{},[1223],{"type":33,"value":1224},"  backup_window           = \"10:46-11:16\"\n",{"type":24,"tag":528,"props":1226,"children":1227},{"class":530,"line":816},[1228],{"type":24,"tag":528,"props":1229,"children":1230},{},[1231],{"type":33,"value":1232},"  maintenance_window      = \"Mon:00:00-Mon:03:00\"\n",{"type":24,"tag":528,"props":1234,"children":1235},{"class":530,"line":825},[1236],{"type":24,"tag":528,"props":1237,"children":1238},{},[1239],{"type":33,"value":1240},"  engine                  = \"mysql\"\n",{"type":24,"tag":528,"props":1242,"children":1243},{"class":530,"line":834},[1244],{"type":24,"tag":528,"props":1245,"children":1246},{},[1247],{"type":33,"value":1248},"  engine_version          = \"8.0.15\"\n",{"type":24,"tag":528,"props":1250,"children":1251},{"class":530,"line":843},[1252],{"type":24,"tag":528,"props":1253,"children":1254},{},[1255],{"type":33,"value":1256},"  instance_class          = \"db.t2.micro\"\n",{"type":24,"tag":528,"props":1258,"children":1259},{"class":530,"line":852},[1260],{"type":24,"tag":528,"props":1261,"children":1262},{},[1263],{"type":33,"value":1264},"  username                = var.rds-username\n",{"type":24,"tag":528,"props":1266,"children":1267},{"class":530,"line":861},[1268],{"type":24,"tag":528,"props":1269,"children":1270},{},[1271],{"type":33,"value":1272},"  password                = var.rds-password\n",{"type":24,"tag":528,"props":1274,"children":1275},{"class":530,"line":869},[1276],{"type":24,"tag":528,"props":1277,"children":1278},{},[1279],{"type":33,"value":1280},"  port                    = var.rds-port\n",{"type":24,"tag":528,"props":1282,"children":1283},{"class":530,"line":878},[1284],{"type":24,"tag":528,"props":1285,"children":1286},{},[1287],{"type":33,"value":1288},"  publicly_accessible     = true\n",{"type":24,"tag":528,"props":1290,"children":1291},{"class":530,"line":886},[1292],{"type":24,"tag":528,"props":1293,"children":1294},{},[1295],{"type":33,"value":1296},"  storage_type            = \"gp2\"\n",{"type":24,"tag":528,"props":1298,"children":1299},{"class":530,"line":894},[1300],{"type":24,"tag":528,"props":1301,"children":1302},{"emptyLinePlaceholder":605},[1303],{"type":33,"value":608},{"type":24,"tag":528,"props":1305,"children":1306},{"class":530,"line":903},[1307],{"type":24,"tag":528,"props":1308,"children":1309},{},[1310],{"type":33,"value":1311},"  allow_major_version_upgrade  = false\n",{"type":24,"tag":528,"props":1313,"children":1314},{"class":530,"line":912},[1315],{"type":24,"tag":528,"props":1316,"children":1317},{},[1318],{"type":33,"value":1319},"  auto_minor_version_upgrade   = true\n",{"type":24,"tag":528,"props":1321,"children":1322},{"class":530,"line":921},[1323],{"type":24,"tag":528,"props":1324,"children":1325},{},[1326],{"type":33,"value":1327},"  performance_insights_enabled = false\n",{"type":24,"tag":528,"props":1329,"children":1330},{"class":530,"line":930},[1331],{"type":24,"tag":528,"props":1332,"children":1333},{},[1334],{"type":33,"value":1335},"  skip_final_snapshot          = true\n",{"type":24,"tag":528,"props":1337,"children":1338},{"class":530,"line":939},[1339],{"type":24,"tag":528,"props":1340,"children":1341},{},[1342],{"type":33,"value":1343},"  final_snapshot_identifier = \"database-${var.rds-schema}-snapshot\"\n",{"type":24,"tag":528,"props":1345,"children":1346},{"class":530,"line":947},[1347],{"type":24,"tag":528,"props":1348,"children":1349},{"emptyLinePlaceholder":605},[1350],{"type":33,"value":608},{"type":24,"tag":528,"props":1352,"children":1354},{"class":530,"line":1353},50,[1355],{"type":24,"tag":528,"props":1356,"children":1357},{},[1358],{"type":33,"value":1359},"  vpc_security_group_ids = [aws_security_group.rds-sg.id]\n",{"type":24,"tag":528,"props":1361,"children":1363},{"class":530,"line":1362},51,[1364],{"type":24,"tag":528,"props":1365,"children":1366},{},[1367],{"type":33,"value":1368},"  availability_zone         = var.rds-availability_zone\n",{"type":24,"tag":528,"props":1370,"children":1372},{"class":530,"line":1371},52,[1373],{"type":24,"tag":528,"props":1374,"children":1375},{},[1376],{"type":33,"value":1377},"  multi_az                  = var.rds-multi_az \n",{"type":24,"tag":528,"props":1379,"children":1381},{"class":530,"line":1380},53,[1382],{"type":24,"tag":528,"props":1383,"children":1384},{},[1385],{"type":33,"value":598},{"type":24,"tag":44,"props":1387,"children":1389},{"id":1388},"step-3-elastic-beanstalk",[1390],{"type":33,"value":1391},"Step 3 - Elastic Beanstalk",{"type":24,"tag":29,"props":1393,"children":1394},{},[1395,1397,1402],{"type":33,"value":1396},"Elastic Beanstalk is a great way to deploy Java applications, you only need to focus on the application. The service\ncan be configured as a ",{"type":24,"tag":36,"props":1398,"children":1399},{},[1400],{"type":33,"value":1401},"single instance or load balanced",{"type":33,"value":1403},". In this example we are going to deploy single instance, but\nfor production applications is highly recommended configuring as load balanced with a minimum of 2 instances, is not\nonly about performance, with this configuration when you deploy a new version AWS will replace 1 instance at the time\nand wait to be in healthy state, this way we can achieve 0 downtime.",{"type":24,"tag":148,"props":1405,"children":1407},{"className":520,"code":1406,"language":522,"meta":8,"style":8},"resource \"aws_security_group\" \"eb-sg\" {\n  name = \"eb-sg\"\n  description = \"SecurityGroup for ElasticBeanstalk environment.\"\n  vpc_id = module.vpc._.vpc_id\n  ingress {\n    from_port = 80\n    to_port = 80\n    protocol = \"tcp\"\n    cidr_blocks = [\"0.0.0.0/0\"]\n    ipv6_cidr_blocks = [\"::/0\"]\n  }\n  ingress {\n    from_port = 587\n    to_port = 587\n    protocol = \"tcp\"\n    cidr_blocks = [\"0.0.0.0/0\"]\n    ipv6_cidr_blocks = [\"::/0\"]\n  }\n  egress {\n    from_port = 0\n    to_port = 0\n    protocol = \"-1\"\n    cidr_blocks = [\"0.0.0.0/0\"]\n  }\n  tags = {\n    Name = \"EB_sg\"\n  }\n}\n\n# ElasticBeanstalk - Application\nresource \"aws_elastic_beanstalk_application\" \"eb-application\" {\n  name = var.app-name\n  depends_on = [aws_db_instance.rds-db]\n}\n\n# ElasticBeanstalk - Environment\nresource \"aws_elastic_beanstalk_environment\" \"eb-env-prod\" {\n\n  depends_on = [aws_db_instance.rds-db]\n\n  name                = \"${var.app-name}-prod\"\n  application         = aws_elastic_beanstalk_application.eb-application.name\n  solution_stack_name = data.aws_elastic_beanstalk_solution_stack.java8.name\n  cname_prefix        = var.app-name\n\n  setting {\n    namespace = \"aws:autoscaling:launchconfiguration\"\n    name = \"InstanceType\"\n    value = \"t2.micro\"\n  }\n  setting {\n    namespace = \"aws:elasticbeanstalk:environment\"\n    name = \"EnvironmentType\"\n    value = \"SingleInstance\"\n  }\n  setting {\n    namespace = \"aws:autoscaling:launchconfiguration\"\n    name = \"IamInstanceProfile\"\n    value = \"aws-elasticbeanstalk-ec2-role\"\n  }\n  setting {\n    namespace = \"aws:autoscaling:launchconfiguration\"\n    name = \"InstanceType\"\n    value = \"t2.micro\"\n  }\n  setting {\n    namespace = \"aws:elasticbeanstalk:application:environment\"\n    name = \"SPRING_PROFILES_ACTIVE\"\n    value = \"prod\"\n  }\n  setting {\n    namespace = \"aws:elasticbeanstalk:application:environment\"\n    name = \"SPRING_DATASOURCE_URL\"\n    value = \"jdbc:mysql://${aws_db_instance.rds-db.endpoint}/${aws_db_instance.rds-db.name}?useSSL=false\"\n  }\n  setting {\n    namespace = \"aws:elasticbeanstalk:application:environment\"\n    name = \"SPRING_DATASOURCE_USERNAME\"\n    value = aws_db_instance.rds-db.username\n  }\n  setting {\n    namespace = \"aws:elasticbeanstalk:application:environment\"\n    name = \"SPRING_DATASOURCE_PASSWORD\"\n    value = aws_db_instance.rds-db.password\n  }\n  setting {\n    namespace = \"aws:autoscaling:launchconfiguration\"\n    name = \"SecurityGroups\"\n    value = aws_security_group.eb-sg.id\n  }\n  setting {\n    namespace = \"aws:ec2:vpc\"\n    name      = \"VPCId\"\n    value     = module.vpc._.vpc_id\n  }\n  setting {\n    namespace = \"aws:ec2:vpc\"\n    name      = \"Subnets\"\n    value     = module.vpc._.subnet_a\n  }\n  setting {\n    namespace = \"aws:ec2:vpc\"\n    name = \"VPCId\"\n    value = module.vpc._.vpc_id\n  }\n  setting {\n    namespace = \"aws:ec2:vpc\"\n    name = \"AssociatePublicIpAddress\"\n    value = \"true\"\n  }\n}\n",[1408],{"type":24,"tag":15,"props":1409,"children":1410},{"__ignoreMap":8},[1411,1419,1427,1435,1442,1449,1457,1465,1473,1480,1488,1495,1502,1510,1518,1525,1532,1539,1546,1553,1561,1569,1577,1584,1591,1598,1606,1613,1620,1627,1635,1643,1651,1659,1666,1673,1681,1689,1696,1703,1710,1718,1726,1734,1742,1749,1757,1765,1773,1781,1788,1795,1803,1811,1820,1828,1836,1844,1853,1862,1870,1878,1886,1894,1902,1910,1918,1927,1936,1945,1953,1961,1969,1978,1987,1995,2003,2011,2020,2029,2037,2045,2053,2062,2071,2079,2087,2095,2104,2113,2121,2129,2138,2147,2156,2164,2172,2180,2189,2198,2206,2214,2222,2231,2240,2248,2256,2264,2273,2282,2290],{"type":24,"tag":528,"props":1412,"children":1413},{"class":530,"line":531},[1414],{"type":24,"tag":528,"props":1415,"children":1416},{},[1417],{"type":33,"value":1418},"resource \"aws_security_group\" \"eb-sg\" {\n",{"type":24,"tag":528,"props":1420,"children":1421},{"class":530,"line":412},[1422],{"type":24,"tag":528,"props":1423,"children":1424},{},[1425],{"type":33,"value":1426},"  name = \"eb-sg\"\n",{"type":24,"tag":528,"props":1428,"children":1429},{"class":530,"line":278},[1430],{"type":24,"tag":528,"props":1431,"children":1432},{},[1433],{"type":33,"value":1434},"  description = \"SecurityGroup for ElasticBeanstalk environment.\"\n",{"type":24,"tag":528,"props":1436,"children":1437},{"class":530,"line":556},[1438],{"type":24,"tag":528,"props":1439,"children":1440},{},[1441],{"type":33,"value":1009},{"type":24,"tag":528,"props":1443,"children":1444},{"class":530,"line":565},[1445],{"type":24,"tag":528,"props":1446,"children":1447},{},[1448],{"type":33,"value":1032},{"type":24,"tag":528,"props":1450,"children":1451},{"class":530,"line":574},[1452],{"type":24,"tag":528,"props":1453,"children":1454},{},[1455],{"type":33,"value":1456},"    from_port = 80\n",{"type":24,"tag":528,"props":1458,"children":1459},{"class":530,"line":583},[1460],{"type":24,"tag":528,"props":1461,"children":1462},{},[1463],{"type":33,"value":1464},"    to_port = 80\n",{"type":24,"tag":528,"props":1466,"children":1467},{"class":530,"line":592},[1468],{"type":24,"tag":528,"props":1469,"children":1470},{},[1471],{"type":33,"value":1472},"    protocol = \"tcp\"\n",{"type":24,"tag":528,"props":1474,"children":1475},{"class":530,"line":601},[1476],{"type":24,"tag":528,"props":1477,"children":1478},{},[1479],{"type":33,"value":1119},{"type":24,"tag":528,"props":1481,"children":1482},{"class":530,"line":611},[1483],{"type":24,"tag":528,"props":1484,"children":1485},{},[1486],{"type":33,"value":1487},"    ipv6_cidr_blocks = [\"::/0\"]\n",{"type":24,"tag":528,"props":1489,"children":1490},{"class":530,"line":620},[1491],{"type":24,"tag":528,"props":1492,"children":1493},{},[1494],{"type":33,"value":589},{"type":24,"tag":528,"props":1496,"children":1497},{"class":530,"line":629},[1498],{"type":24,"tag":528,"props":1499,"children":1500},{},[1501],{"type":33,"value":1032},{"type":24,"tag":528,"props":1503,"children":1504},{"class":530,"line":637},[1505],{"type":24,"tag":528,"props":1506,"children":1507},{},[1508],{"type":33,"value":1509},"    from_port = 587\n",{"type":24,"tag":528,"props":1511,"children":1512},{"class":530,"line":646},[1513],{"type":24,"tag":528,"props":1514,"children":1515},{},[1516],{"type":33,"value":1517},"    to_port = 587\n",{"type":24,"tag":528,"props":1519,"children":1520},{"class":530,"line":654},[1521],{"type":24,"tag":528,"props":1522,"children":1523},{},[1524],{"type":33,"value":1472},{"type":24,"tag":528,"props":1526,"children":1527},{"class":530,"line":662},[1528],{"type":24,"tag":528,"props":1529,"children":1530},{},[1531],{"type":33,"value":1119},{"type":24,"tag":528,"props":1533,"children":1534},{"class":530,"line":670},[1535],{"type":24,"tag":528,"props":1536,"children":1537},{},[1538],{"type":33,"value":1487},{"type":24,"tag":528,"props":1540,"children":1541},{"class":530,"line":679},[1542],{"type":24,"tag":528,"props":1543,"children":1544},{},[1545],{"type":33,"value":589},{"type":24,"tag":528,"props":1547,"children":1548},{"class":530,"line":687},[1549],{"type":24,"tag":528,"props":1550,"children":1551},{},[1552],{"type":33,"value":1087},{"type":24,"tag":528,"props":1554,"children":1555},{"class":530,"line":695},[1556],{"type":24,"tag":528,"props":1557,"children":1558},{},[1559],{"type":33,"value":1560},"    from_port = 0\n",{"type":24,"tag":528,"props":1562,"children":1563},{"class":530,"line":704},[1564],{"type":24,"tag":528,"props":1565,"children":1566},{},[1567],{"type":33,"value":1568},"    to_port = 0\n",{"type":24,"tag":528,"props":1570,"children":1571},{"class":530,"line":713},[1572],{"type":24,"tag":528,"props":1573,"children":1574},{},[1575],{"type":33,"value":1576},"    protocol = \"-1\"\n",{"type":24,"tag":528,"props":1578,"children":1579},{"class":530,"line":721},[1580],{"type":24,"tag":528,"props":1581,"children":1582},{},[1583],{"type":33,"value":1119},{"type":24,"tag":528,"props":1585,"children":1586},{"class":530,"line":730},[1587],{"type":24,"tag":528,"props":1588,"children":1589},{},[1590],{"type":33,"value":589},{"type":24,"tag":528,"props":1592,"children":1593},{"class":530,"line":739},[1594],{"type":24,"tag":528,"props":1595,"children":1596},{},[1597],{"type":33,"value":571},{"type":24,"tag":528,"props":1599,"children":1600},{"class":530,"line":748},[1601],{"type":24,"tag":528,"props":1602,"children":1603},{},[1604],{"type":33,"value":1605},"    Name = \"EB_sg\"\n",{"type":24,"tag":528,"props":1607,"children":1608},{"class":530,"line":757},[1609],{"type":24,"tag":528,"props":1610,"children":1611},{},[1612],{"type":33,"value":589},{"type":24,"tag":528,"props":1614,"children":1615},{"class":530,"line":766},[1616],{"type":24,"tag":528,"props":1617,"children":1618},{},[1619],{"type":33,"value":598},{"type":24,"tag":528,"props":1621,"children":1622},{"class":530,"line":775},[1623],{"type":24,"tag":528,"props":1624,"children":1625},{"emptyLinePlaceholder":605},[1626],{"type":33,"value":608},{"type":24,"tag":528,"props":1628,"children":1629},{"class":530,"line":783},[1630],{"type":24,"tag":528,"props":1631,"children":1632},{},[1633],{"type":33,"value":1634},"# ElasticBeanstalk - Application\n",{"type":24,"tag":528,"props":1636,"children":1637},{"class":530,"line":791},[1638],{"type":24,"tag":528,"props":1639,"children":1640},{},[1641],{"type":33,"value":1642},"resource \"aws_elastic_beanstalk_application\" \"eb-application\" {\n",{"type":24,"tag":528,"props":1644,"children":1645},{"class":530,"line":800},[1646],{"type":24,"tag":528,"props":1647,"children":1648},{},[1649],{"type":33,"value":1650},"  name = var.app-name\n",{"type":24,"tag":528,"props":1652,"children":1653},{"class":530,"line":808},[1654],{"type":24,"tag":528,"props":1655,"children":1656},{},[1657],{"type":33,"value":1658},"  depends_on = [aws_db_instance.rds-db]\n",{"type":24,"tag":528,"props":1660,"children":1661},{"class":530,"line":816},[1662],{"type":24,"tag":528,"props":1663,"children":1664},{},[1665],{"type":33,"value":598},{"type":24,"tag":528,"props":1667,"children":1668},{"class":530,"line":825},[1669],{"type":24,"tag":528,"props":1670,"children":1671},{"emptyLinePlaceholder":605},[1672],{"type":33,"value":608},{"type":24,"tag":528,"props":1674,"children":1675},{"class":530,"line":834},[1676],{"type":24,"tag":528,"props":1677,"children":1678},{},[1679],{"type":33,"value":1680},"# ElasticBeanstalk - Environment\n",{"type":24,"tag":528,"props":1682,"children":1683},{"class":530,"line":843},[1684],{"type":24,"tag":528,"props":1685,"children":1686},{},[1687],{"type":33,"value":1688},"resource \"aws_elastic_beanstalk_environment\" \"eb-env-prod\" {\n",{"type":24,"tag":528,"props":1690,"children":1691},{"class":530,"line":852},[1692],{"type":24,"tag":528,"props":1693,"children":1694},{"emptyLinePlaceholder":605},[1695],{"type":33,"value":608},{"type":24,"tag":528,"props":1697,"children":1698},{"class":530,"line":861},[1699],{"type":24,"tag":528,"props":1700,"children":1701},{},[1702],{"type":33,"value":1658},{"type":24,"tag":528,"props":1704,"children":1705},{"class":530,"line":869},[1706],{"type":24,"tag":528,"props":1707,"children":1708},{"emptyLinePlaceholder":605},[1709],{"type":33,"value":608},{"type":24,"tag":528,"props":1711,"children":1712},{"class":530,"line":878},[1713],{"type":24,"tag":528,"props":1714,"children":1715},{},[1716],{"type":33,"value":1717},"  name                = \"${var.app-name}-prod\"\n",{"type":24,"tag":528,"props":1719,"children":1720},{"class":530,"line":886},[1721],{"type":24,"tag":528,"props":1722,"children":1723},{},[1724],{"type":33,"value":1725},"  application         = aws_elastic_beanstalk_application.eb-application.name\n",{"type":24,"tag":528,"props":1727,"children":1728},{"class":530,"line":894},[1729],{"type":24,"tag":528,"props":1730,"children":1731},{},[1732],{"type":33,"value":1733},"  solution_stack_name = data.aws_elastic_beanstalk_solution_stack.java8.name\n",{"type":24,"tag":528,"props":1735,"children":1736},{"class":530,"line":903},[1737],{"type":24,"tag":528,"props":1738,"children":1739},{},[1740],{"type":33,"value":1741},"  cname_prefix        = var.app-name\n",{"type":24,"tag":528,"props":1743,"children":1744},{"class":530,"line":912},[1745],{"type":24,"tag":528,"props":1746,"children":1747},{"emptyLinePlaceholder":605},[1748],{"type":33,"value":608},{"type":24,"tag":528,"props":1750,"children":1751},{"class":530,"line":921},[1752],{"type":24,"tag":528,"props":1753,"children":1754},{},[1755],{"type":33,"value":1756},"  setting {\n",{"type":24,"tag":528,"props":1758,"children":1759},{"class":530,"line":930},[1760],{"type":24,"tag":528,"props":1761,"children":1762},{},[1763],{"type":33,"value":1764},"    namespace = \"aws:autoscaling:launchconfiguration\"\n",{"type":24,"tag":528,"props":1766,"children":1767},{"class":530,"line":939},[1768],{"type":24,"tag":528,"props":1769,"children":1770},{},[1771],{"type":33,"value":1772},"    name = \"InstanceType\"\n",{"type":24,"tag":528,"props":1774,"children":1775},{"class":530,"line":947},[1776],{"type":24,"tag":528,"props":1777,"children":1778},{},[1779],{"type":33,"value":1780},"    value = \"t2.micro\"\n",{"type":24,"tag":528,"props":1782,"children":1783},{"class":530,"line":1353},[1784],{"type":24,"tag":528,"props":1785,"children":1786},{},[1787],{"type":33,"value":589},{"type":24,"tag":528,"props":1789,"children":1790},{"class":530,"line":1362},[1791],{"type":24,"tag":528,"props":1792,"children":1793},{},[1794],{"type":33,"value":1756},{"type":24,"tag":528,"props":1796,"children":1797},{"class":530,"line":1371},[1798],{"type":24,"tag":528,"props":1799,"children":1800},{},[1801],{"type":33,"value":1802},"    namespace = \"aws:elasticbeanstalk:environment\"\n",{"type":24,"tag":528,"props":1804,"children":1805},{"class":530,"line":1380},[1806],{"type":24,"tag":528,"props":1807,"children":1808},{},[1809],{"type":33,"value":1810},"    name = \"EnvironmentType\"\n",{"type":24,"tag":528,"props":1812,"children":1814},{"class":530,"line":1813},54,[1815],{"type":24,"tag":528,"props":1816,"children":1817},{},[1818],{"type":33,"value":1819},"    value = \"SingleInstance\"\n",{"type":24,"tag":528,"props":1821,"children":1823},{"class":530,"line":1822},55,[1824],{"type":24,"tag":528,"props":1825,"children":1826},{},[1827],{"type":33,"value":589},{"type":24,"tag":528,"props":1829,"children":1831},{"class":530,"line":1830},56,[1832],{"type":24,"tag":528,"props":1833,"children":1834},{},[1835],{"type":33,"value":1756},{"type":24,"tag":528,"props":1837,"children":1839},{"class":530,"line":1838},57,[1840],{"type":24,"tag":528,"props":1841,"children":1842},{},[1843],{"type":33,"value":1764},{"type":24,"tag":528,"props":1845,"children":1847},{"class":530,"line":1846},58,[1848],{"type":24,"tag":528,"props":1849,"children":1850},{},[1851],{"type":33,"value":1852},"    name = \"IamInstanceProfile\"\n",{"type":24,"tag":528,"props":1854,"children":1856},{"class":530,"line":1855},59,[1857],{"type":24,"tag":528,"props":1858,"children":1859},{},[1860],{"type":33,"value":1861},"    value = \"aws-elasticbeanstalk-ec2-role\"\n",{"type":24,"tag":528,"props":1863,"children":1865},{"class":530,"line":1864},60,[1866],{"type":24,"tag":528,"props":1867,"children":1868},{},[1869],{"type":33,"value":589},{"type":24,"tag":528,"props":1871,"children":1873},{"class":530,"line":1872},61,[1874],{"type":24,"tag":528,"props":1875,"children":1876},{},[1877],{"type":33,"value":1756},{"type":24,"tag":528,"props":1879,"children":1881},{"class":530,"line":1880},62,[1882],{"type":24,"tag":528,"props":1883,"children":1884},{},[1885],{"type":33,"value":1764},{"type":24,"tag":528,"props":1887,"children":1889},{"class":530,"line":1888},63,[1890],{"type":24,"tag":528,"props":1891,"children":1892},{},[1893],{"type":33,"value":1772},{"type":24,"tag":528,"props":1895,"children":1897},{"class":530,"line":1896},64,[1898],{"type":24,"tag":528,"props":1899,"children":1900},{},[1901],{"type":33,"value":1780},{"type":24,"tag":528,"props":1903,"children":1905},{"class":530,"line":1904},65,[1906],{"type":24,"tag":528,"props":1907,"children":1908},{},[1909],{"type":33,"value":589},{"type":24,"tag":528,"props":1911,"children":1913},{"class":530,"line":1912},66,[1914],{"type":24,"tag":528,"props":1915,"children":1916},{},[1917],{"type":33,"value":1756},{"type":24,"tag":528,"props":1919,"children":1921},{"class":530,"line":1920},67,[1922],{"type":24,"tag":528,"props":1923,"children":1924},{},[1925],{"type":33,"value":1926},"    namespace = \"aws:elasticbeanstalk:application:environment\"\n",{"type":24,"tag":528,"props":1928,"children":1930},{"class":530,"line":1929},68,[1931],{"type":24,"tag":528,"props":1932,"children":1933},{},[1934],{"type":33,"value":1935},"    name = \"SPRING_PROFILES_ACTIVE\"\n",{"type":24,"tag":528,"props":1937,"children":1939},{"class":530,"line":1938},69,[1940],{"type":24,"tag":528,"props":1941,"children":1942},{},[1943],{"type":33,"value":1944},"    value = \"prod\"\n",{"type":24,"tag":528,"props":1946,"children":1948},{"class":530,"line":1947},70,[1949],{"type":24,"tag":528,"props":1950,"children":1951},{},[1952],{"type":33,"value":589},{"type":24,"tag":528,"props":1954,"children":1956},{"class":530,"line":1955},71,[1957],{"type":24,"tag":528,"props":1958,"children":1959},{},[1960],{"type":33,"value":1756},{"type":24,"tag":528,"props":1962,"children":1964},{"class":530,"line":1963},72,[1965],{"type":24,"tag":528,"props":1966,"children":1967},{},[1968],{"type":33,"value":1926},{"type":24,"tag":528,"props":1970,"children":1972},{"class":530,"line":1971},73,[1973],{"type":24,"tag":528,"props":1974,"children":1975},{},[1976],{"type":33,"value":1977},"    name = \"SPRING_DATASOURCE_URL\"\n",{"type":24,"tag":528,"props":1979,"children":1981},{"class":530,"line":1980},74,[1982],{"type":24,"tag":528,"props":1983,"children":1984},{},[1985],{"type":33,"value":1986},"    value = \"jdbc:mysql://${aws_db_instance.rds-db.endpoint}/${aws_db_instance.rds-db.name}?useSSL=false\"\n",{"type":24,"tag":528,"props":1988,"children":1990},{"class":530,"line":1989},75,[1991],{"type":24,"tag":528,"props":1992,"children":1993},{},[1994],{"type":33,"value":589},{"type":24,"tag":528,"props":1996,"children":1998},{"class":530,"line":1997},76,[1999],{"type":24,"tag":528,"props":2000,"children":2001},{},[2002],{"type":33,"value":1756},{"type":24,"tag":528,"props":2004,"children":2006},{"class":530,"line":2005},77,[2007],{"type":24,"tag":528,"props":2008,"children":2009},{},[2010],{"type":33,"value":1926},{"type":24,"tag":528,"props":2012,"children":2014},{"class":530,"line":2013},78,[2015],{"type":24,"tag":528,"props":2016,"children":2017},{},[2018],{"type":33,"value":2019},"    name = \"SPRING_DATASOURCE_USERNAME\"\n",{"type":24,"tag":528,"props":2021,"children":2023},{"class":530,"line":2022},79,[2024],{"type":24,"tag":528,"props":2025,"children":2026},{},[2027],{"type":33,"value":2028},"    value = aws_db_instance.rds-db.username\n",{"type":24,"tag":528,"props":2030,"children":2032},{"class":530,"line":2031},80,[2033],{"type":24,"tag":528,"props":2034,"children":2035},{},[2036],{"type":33,"value":589},{"type":24,"tag":528,"props":2038,"children":2040},{"class":530,"line":2039},81,[2041],{"type":24,"tag":528,"props":2042,"children":2043},{},[2044],{"type":33,"value":1756},{"type":24,"tag":528,"props":2046,"children":2048},{"class":530,"line":2047},82,[2049],{"type":24,"tag":528,"props":2050,"children":2051},{},[2052],{"type":33,"value":1926},{"type":24,"tag":528,"props":2054,"children":2056},{"class":530,"line":2055},83,[2057],{"type":24,"tag":528,"props":2058,"children":2059},{},[2060],{"type":33,"value":2061},"    name = \"SPRING_DATASOURCE_PASSWORD\"\n",{"type":24,"tag":528,"props":2063,"children":2065},{"class":530,"line":2064},84,[2066],{"type":24,"tag":528,"props":2067,"children":2068},{},[2069],{"type":33,"value":2070},"    value = aws_db_instance.rds-db.password\n",{"type":24,"tag":528,"props":2072,"children":2074},{"class":530,"line":2073},85,[2075],{"type":24,"tag":528,"props":2076,"children":2077},{},[2078],{"type":33,"value":589},{"type":24,"tag":528,"props":2080,"children":2082},{"class":530,"line":2081},86,[2083],{"type":24,"tag":528,"props":2084,"children":2085},{},[2086],{"type":33,"value":1756},{"type":24,"tag":528,"props":2088,"children":2090},{"class":530,"line":2089},87,[2091],{"type":24,"tag":528,"props":2092,"children":2093},{},[2094],{"type":33,"value":1764},{"type":24,"tag":528,"props":2096,"children":2098},{"class":530,"line":2097},88,[2099],{"type":24,"tag":528,"props":2100,"children":2101},{},[2102],{"type":33,"value":2103},"    name = \"SecurityGroups\"\n",{"type":24,"tag":528,"props":2105,"children":2107},{"class":530,"line":2106},89,[2108],{"type":24,"tag":528,"props":2109,"children":2110},{},[2111],{"type":33,"value":2112},"    value = aws_security_group.eb-sg.id\n",{"type":24,"tag":528,"props":2114,"children":2116},{"class":530,"line":2115},90,[2117],{"type":24,"tag":528,"props":2118,"children":2119},{},[2120],{"type":33,"value":589},{"type":24,"tag":528,"props":2122,"children":2124},{"class":530,"line":2123},91,[2125],{"type":24,"tag":528,"props":2126,"children":2127},{},[2128],{"type":33,"value":1756},{"type":24,"tag":528,"props":2130,"children":2132},{"class":530,"line":2131},92,[2133],{"type":24,"tag":528,"props":2134,"children":2135},{},[2136],{"type":33,"value":2137},"    namespace = \"aws:ec2:vpc\"\n",{"type":24,"tag":528,"props":2139,"children":2141},{"class":530,"line":2140},93,[2142],{"type":24,"tag":528,"props":2143,"children":2144},{},[2145],{"type":33,"value":2146},"    name      = \"VPCId\"\n",{"type":24,"tag":528,"props":2148,"children":2150},{"class":530,"line":2149},94,[2151],{"type":24,"tag":528,"props":2152,"children":2153},{},[2154],{"type":33,"value":2155},"    value     = module.vpc._.vpc_id\n",{"type":24,"tag":528,"props":2157,"children":2159},{"class":530,"line":2158},95,[2160],{"type":24,"tag":528,"props":2161,"children":2162},{},[2163],{"type":33,"value":589},{"type":24,"tag":528,"props":2165,"children":2167},{"class":530,"line":2166},96,[2168],{"type":24,"tag":528,"props":2169,"children":2170},{},[2171],{"type":33,"value":1756},{"type":24,"tag":528,"props":2173,"children":2175},{"class":530,"line":2174},97,[2176],{"type":24,"tag":528,"props":2177,"children":2178},{},[2179],{"type":33,"value":2137},{"type":24,"tag":528,"props":2181,"children":2183},{"class":530,"line":2182},98,[2184],{"type":24,"tag":528,"props":2185,"children":2186},{},[2187],{"type":33,"value":2188},"    name      = \"Subnets\"\n",{"type":24,"tag":528,"props":2190,"children":2192},{"class":530,"line":2191},99,[2193],{"type":24,"tag":528,"props":2194,"children":2195},{},[2196],{"type":33,"value":2197},"    value     = module.vpc._.subnet_a\n",{"type":24,"tag":528,"props":2199,"children":2201},{"class":530,"line":2200},100,[2202],{"type":24,"tag":528,"props":2203,"children":2204},{},[2205],{"type":33,"value":589},{"type":24,"tag":528,"props":2207,"children":2209},{"class":530,"line":2208},101,[2210],{"type":24,"tag":528,"props":2211,"children":2212},{},[2213],{"type":33,"value":1756},{"type":24,"tag":528,"props":2215,"children":2217},{"class":530,"line":2216},102,[2218],{"type":24,"tag":528,"props":2219,"children":2220},{},[2221],{"type":33,"value":2137},{"type":24,"tag":528,"props":2223,"children":2225},{"class":530,"line":2224},103,[2226],{"type":24,"tag":528,"props":2227,"children":2228},{},[2229],{"type":33,"value":2230},"    name = \"VPCId\"\n",{"type":24,"tag":528,"props":2232,"children":2234},{"class":530,"line":2233},104,[2235],{"type":24,"tag":528,"props":2236,"children":2237},{},[2238],{"type":33,"value":2239},"    value = module.vpc._.vpc_id\n",{"type":24,"tag":528,"props":2241,"children":2243},{"class":530,"line":2242},105,[2244],{"type":24,"tag":528,"props":2245,"children":2246},{},[2247],{"type":33,"value":589},{"type":24,"tag":528,"props":2249,"children":2251},{"class":530,"line":2250},106,[2252],{"type":24,"tag":528,"props":2253,"children":2254},{},[2255],{"type":33,"value":1756},{"type":24,"tag":528,"props":2257,"children":2259},{"class":530,"line":2258},107,[2260],{"type":24,"tag":528,"props":2261,"children":2262},{},[2263],{"type":33,"value":2137},{"type":24,"tag":528,"props":2265,"children":2267},{"class":530,"line":2266},108,[2268],{"type":24,"tag":528,"props":2269,"children":2270},{},[2271],{"type":33,"value":2272},"    name = \"AssociatePublicIpAddress\"\n",{"type":24,"tag":528,"props":2274,"children":2276},{"class":530,"line":2275},109,[2277],{"type":24,"tag":528,"props":2278,"children":2279},{},[2280],{"type":33,"value":2281},"    value = \"true\"\n",{"type":24,"tag":528,"props":2283,"children":2285},{"class":530,"line":2284},110,[2286],{"type":24,"tag":528,"props":2287,"children":2288},{},[2289],{"type":33,"value":589},{"type":24,"tag":528,"props":2291,"children":2293},{"class":530,"line":2292},111,[2294],{"type":24,"tag":528,"props":2295,"children":2296},{},[2297],{"type":33,"value":598},{"type":24,"tag":44,"props":2299,"children":2301},{"id":2300},"deploy-infrastructure",[2302],{"type":33,"value":2303},"Deploy infrastructure",{"type":24,"tag":29,"props":2305,"children":2306},{},[2307],{"type":33,"value":2308},"With terraform, only we need to do is execute the following command, providing a file with all the variables we have defined",{"type":24,"tag":148,"props":2310,"children":2314},{"className":2311,"code":2312,"language":2313,"meta":8,"style":8},"language-bash shiki shiki-themes github-dark github-light","terraform apply -var-file=\"test.tfvars\"\n","bash",[2315],{"type":24,"tag":15,"props":2316,"children":2317},{"__ignoreMap":8},[2318],{"type":24,"tag":528,"props":2319,"children":2320},{"class":530,"line":531},[2321,2326,2332,2338],{"type":24,"tag":528,"props":2322,"children":2324},{"style":2323},"--shiki-default:#B392F0;--shiki-light:#6F42C1",[2325],{"type":33,"value":434},{"type":24,"tag":528,"props":2327,"children":2329},{"style":2328},"--shiki-default:#9ECBFF;--shiki-light:#032F62",[2330],{"type":33,"value":2331}," apply",{"type":24,"tag":528,"props":2333,"children":2335},{"style":2334},"--shiki-default:#79B8FF;--shiki-light:#005CC5",[2336],{"type":33,"value":2337}," -var-file=",{"type":24,"tag":528,"props":2339,"children":2340},{"style":2328},[2341],{"type":33,"value":2342},"\"test.tfvars\"\n",{"type":24,"tag":25,"props":2344,"children":2345},{},[2346],{"type":24,"tag":29,"props":2347,"children":2348},{},[2349],{"type":24,"tag":160,"props":2350,"children":2351},{},[2352,2354],{"type":33,"value":2353},"You can find the complete code of this example in this ",{"type":24,"tag":378,"props":2355,"children":2358},{"href":2356,"target":2357},"https://github.com/JaimeDeArcos/terraform-aws-archetype","_blank",[2359],{"type":33,"value":2360},"GitHub repository",{"type":24,"tag":2362,"props":2363,"children":2364},"style",{},[2365],{"type":33,"value":2366},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}",{"title":8,"searchDepth":412,"depth":412,"links":2368},[2369,2370,2371,2372,2373],{"id":450,"depth":412,"text":453},{"id":471,"depth":412,"text":474},{"id":955,"depth":412,"text":958},{"id":1388,"depth":412,"text":1391},{"id":2300,"depth":412,"text":2303},"content:posts:manage-aws-infrastructure-with-terraform.md","posts/manage-aws-infrastructure-with-terraform.md","posts/manage-aws-infrastructure-with-terraform",1790510064592]