├── outputs.tf ├── main.tf ├── variables.tf ├── README.md └── LICENSE /outputs.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Module: tf_aws_rds 3 | # 4 | 5 | # Output the ID of the RDS instance 6 | output "rds_instance_id" { 7 | value = "${aws_db_instance.main_rds_instance.id}" 8 | } 9 | 10 | # Output the address (aka hostname) of the RDS instance 11 | output "rds_instance_address" { 12 | value = "${aws_db_instance.main_rds_instance.address}" 13 | } 14 | 15 | # Output endpoint (hostname:port) of the RDS instance 16 | output "rds_instance_endpoint" { 17 | value = "${aws_db_instance.main_rds_instance.endpoint}" 18 | } 19 | 20 | # Output the ID of the Subnet Group 21 | output "subnet_group_id" { 22 | value = "${aws_db_subnet_group.main_db_subnet_group.id}" 23 | } 24 | 25 | # Output DB security group ID 26 | output "security_group_id" { 27 | value = "${aws_security_group.main_db_access.id}" 28 | } 29 | -------------------------------------------------------------------------------- /main.tf: -------------------------------------------------------------------------------- 1 | // 2 | // Module: tf_aws_rds 3 | // 4 | 5 | // This template creates the following resources 6 | // - An RDS instance 7 | // - A database subnet group 8 | // - You should want your RDS instance in a VPC 9 | 10 | resource "aws_db_instance" "main_rds_instance" { 11 | identifier = "${var.rds_instance_identifier}" 12 | allocated_storage = "${var.rds_allocated_storage}" 13 | engine = "${var.rds_engine_type}" 14 | engine_version = "${var.rds_engine_version}" 15 | instance_class = "${var.rds_instance_class}" 16 | name = "${var.database_name}" 17 | username = "${var.database_user}" 18 | password = "${var.database_password}" 19 | 20 | port = "${var.database_port}" 21 | 22 | # Because we're assuming a VPC, we use this option, but only one SG id 23 | vpc_security_group_ids = ["${aws_security_group.main_db_access.id}"] 24 | 25 | # We're creating a subnet group in the module and passing in the name 26 | db_subnet_group_name = "${aws_db_subnet_group.main_db_subnet_group.id}" 27 | parameter_group_name = "${var.use_external_parameter_group ? var.parameter_group_name : aws_db_parameter_group.main_rds_instance.id}" 28 | 29 | # We want the multi-az setting to be toggleable, but off by default 30 | multi_az = "${var.rds_is_multi_az}" 31 | storage_type = "${var.rds_storage_type}" 32 | iops = "${var.rds_iops}" 33 | publicly_accessible = "${var.publicly_accessible}" 34 | 35 | # Upgrades 36 | allow_major_version_upgrade = "${var.allow_major_version_upgrade}" 37 | auto_minor_version_upgrade = "${var.auto_minor_version_upgrade}" 38 | apply_immediately = "${var.apply_immediately}" 39 | maintenance_window = "${var.maintenance_window}" 40 | 41 | # Snapshots and backups 42 | skip_final_snapshot = "${var.skip_final_snapshot}" 43 | copy_tags_to_snapshot = "${var.copy_tags_to_snapshot}" 44 | 45 | backup_retention_period = "${var.backup_retention_period}" 46 | backup_window = "${var.backup_window}" 47 | 48 | # enhanced monitoring 49 | monitoring_interval = "${var.monitoring_interval}" 50 | 51 | tags = "${merge(var.tags, map("Name", format("%s", var.rds_instance_identifier)))}" 52 | } 53 | 54 | resource "aws_db_parameter_group" "main_rds_instance" { 55 | count = "${var.use_external_parameter_group ? 0 : 1}" 56 | 57 | name = "${var.rds_instance_identifier}-${replace(var.db_parameter_group, ".", "")}-custom-params" 58 | family = "${var.db_parameter_group}" 59 | 60 | # Example for MySQL 61 | # parameter { 62 | # name = "character_set_server" 63 | # value = "utf8" 64 | # } 65 | 66 | 67 | # parameter { 68 | # name = "character_set_client" 69 | # value = "utf8" 70 | # } 71 | 72 | tags = "${merge(var.tags, map("Name", format("%s", var.rds_instance_identifier)))}" 73 | } 74 | 75 | resource "aws_db_subnet_group" "main_db_subnet_group" { 76 | name = "${var.rds_instance_identifier}-subnetgrp" 77 | description = "RDS subnet group" 78 | subnet_ids = ["${var.subnets}"] 79 | 80 | tags = "${merge(var.tags, map("Name", format("%s", var.rds_instance_identifier)))}" 81 | } 82 | 83 | # Security groups 84 | resource "aws_security_group" "main_db_access" { 85 | name = "${var.rds_instance_identifier}-access" 86 | description = "Allow access to the database" 87 | vpc_id = "${var.rds_vpc_id}" 88 | 89 | tags = "${merge(var.tags, map("Name", format("%s", var.rds_instance_identifier)))}" 90 | } 91 | 92 | resource "aws_security_group_rule" "allow_db_access" { 93 | type = "ingress" 94 | 95 | from_port = "${var.database_port}" 96 | to_port = "${var.database_port}" 97 | protocol = "tcp" 98 | cidr_blocks = ["${var.private_cidr}"] 99 | 100 | security_group_id = "${aws_security_group.main_db_access.id}" 101 | } 102 | 103 | resource "aws_security_group_rule" "allow_all_outbound" { 104 | type = "egress" 105 | 106 | from_port = 0 107 | to_port = 0 108 | protocol = "-1" 109 | cidr_blocks = ["0.0.0.0/0"] 110 | 111 | security_group_id = "${aws_security_group.main_db_access.id}" 112 | } 113 | -------------------------------------------------------------------------------- /variables.tf: -------------------------------------------------------------------------------- 1 | # 2 | # Module: tf_aws_rds 3 | # 4 | 5 | # RDS Instance Variables 6 | 7 | variable "rds_instance_identifier" { 8 | description = "Custom name of the instance" 9 | } 10 | 11 | variable "rds_is_multi_az" { 12 | description = "Set to true on production" 13 | default = false 14 | } 15 | 16 | variable "rds_storage_type" { 17 | description = "One of 'standard' (magnetic), 'gp2' (general purpose SSD), or 'io1' (provisioned IOPS SSD)." 18 | default = "standard" 19 | } 20 | 21 | variable "rds_iops" { 22 | description = "The amount of provisioned IOPS. Setting this implies a storage_type of 'io1', default is 0 if rds storage type is not io1" 23 | default = "0" 24 | } 25 | 26 | variable "rds_allocated_storage" { 27 | description = "The allocated storage in GBs" 28 | 29 | # You just give it the number, e.g. 10 30 | } 31 | 32 | variable "rds_engine_type" { 33 | description = "Database engine type" 34 | 35 | # Valid types are 36 | # - mysql 37 | # - postgres 38 | # - oracle-* 39 | # - sqlserver-* 40 | # See http://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html 41 | # --engine 42 | } 43 | 44 | variable "rds_engine_version" { 45 | description = "Database engine version, depends on engine type" 46 | 47 | # For valid engine versions, see: 48 | # See http://docs.aws.amazon.com/cli/latest/reference/rds/create-db-instance.html 49 | # --engine-version 50 | } 51 | 52 | variable "rds_instance_class" { 53 | description = "Class of RDS instance" 54 | 55 | # Valid values 56 | # https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html 57 | } 58 | 59 | variable "auto_minor_version_upgrade" { 60 | description = "Allow automated minor version upgrade" 61 | default = true 62 | } 63 | 64 | variable "allow_major_version_upgrade" { 65 | description = "Allow major version upgrade" 66 | default = false 67 | } 68 | 69 | variable "apply_immediately" { 70 | description = "Specifies whether any database modifications are applied immediately, or during the next maintenance window" 71 | default = false 72 | } 73 | 74 | variable "maintenance_window" { 75 | description = "The window to perform maintenance in. Syntax: 'ddd:hh24:mi-ddd:hh24:mi' UTC " 76 | default = "Mon:03:00-Mon:04:00" 77 | } 78 | 79 | variable "database_name" { 80 | description = "The name of the database to create" 81 | } 82 | 83 | # Self-explainatory variables 84 | variable "database_user" {} 85 | 86 | variable "database_password" {} 87 | variable "database_port" {} 88 | 89 | # This is for a custom parameter to be passed to the DB 90 | # We're "cloning" default ones, but we need to specify which should be copied 91 | variable "db_parameter_group" { 92 | description = "Parameter group, depends on DB engine used" 93 | 94 | # default = "mysql5.6" 95 | # default = "postgres9.5" 96 | } 97 | 98 | variable "use_external_parameter_group" { 99 | description = "Use parameter group specified by `parameter_group_name` instead of built-in one" 100 | default = false 101 | } 102 | 103 | # Use an external parameter group (i.e. defined in caller of this module) 104 | variable "parameter_group_name" { 105 | description = "Parameter group to use instead of the default" 106 | default = "" 107 | } 108 | 109 | variable "publicly_accessible" { 110 | description = "Determines if database can be publicly available (NOT recommended)" 111 | default = false 112 | } 113 | 114 | # RDS Subnet Group Variables 115 | variable "subnets" { 116 | description = "List of subnets DB should be available at. It might be one subnet." 117 | type = "list" 118 | } 119 | 120 | variable "private_cidr" { 121 | description = "VPC private addressing, used for a security group" 122 | type = "list" 123 | } 124 | 125 | variable "rds_vpc_id" { 126 | description = "VPC to connect to, used for a security group" 127 | type = "string" 128 | } 129 | 130 | variable "skip_final_snapshot" { 131 | description = "If true (default), no snapshot will be made before deleting DB" 132 | default = true 133 | } 134 | 135 | variable "copy_tags_to_snapshot" { 136 | description = "Copy tags from DB to a snapshot" 137 | default = true 138 | } 139 | 140 | variable "backup_window" { 141 | description = "When AWS can run snapshot, can't overlap with maintenance window" 142 | default = "22:00-03:00" 143 | } 144 | 145 | variable "backup_retention_period" { 146 | type = "string" 147 | description = "How long will we retain backups" 148 | default = 0 149 | } 150 | 151 | variable "tags" { 152 | description = "A map of tags to add to all resources" 153 | default = {} 154 | } 155 | 156 | variable "monitoring_interval" { 157 | description = "To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60." 158 | default = "0" 159 | } 160 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tf_aws_rds 2 | 3 | # This module is deprecated and [terraform-aws-modules/terraform-aws-rds module](https://github.com/terraform-aws-modules/terraform-aws-rds) published on [the Terraform registry](https://registry.terraform.io/modules/terraform-aws-modules/rds/aws) should be used instead. 4 | 5 | ## This repository will not have active support any more. 6 | 7 | --- 8 | 9 | A Terraform Template for RDS 10 | 11 | This module makes the following assumptions: 12 | * You want your RDS instance in a VPC 13 | * You have subnets in a VPC for two AZs 14 | * Multi-AZ is optional. 15 | 16 | ## Input Variables 17 | 18 | - `rds_instance_identifier` - Custom name of the DB instance (NOT a database name) 19 | - `rds_is_multi_az` - Defaults to false. Set to true for a multi-az 20 | instance. 21 | - `rds_storage_type` - Defaults to standard (magnetic) 22 | - `rds_iops` - "The amount of provisioned IOPS. Setting this implies a storage_type of 'io1', default is 0 if rds storage type is not io1" 23 | - `rds_allocated_storage` - The number of GBs to allocate. Input must be an 24 | integer, e.g. `10` 25 | - `rds_engine_type` - Engine type, such as `mysql` or `postgres` 26 | - `rds_engine_version` - eg. `9.5.4` in case of postgres 27 | - `rds_instance_class` - instance size, eg. `db.t2.micro` 28 | - `database_name` - name of the dabatase 29 | - `database_user` - user name (admin user) 30 | - `database_password` - password - must be longer than 8 characters 31 | - `db_parameter_group` - Defaults to `mysql5.6`, for postgres `postgres9.5` 32 | - `use_external_parameter_group` - Defaults to `false`, if `true` use parameter group specified by `parameter_group_name` instead of a built-in one 33 | - `parameter_group_name` - name of `aws_db_parameter_group` to use, if `use_external_parameter_group` is set 34 | - `subnets` - List of subnets IDs in a list form, _e.g._ `["sb-1234567890", "sb-0987654321"]` 35 | - `database_port` - Database port (needed for a security group) 36 | - `publicly_accessible` - Defaults to `false` 37 | - `private_cidr` - List of CIDR netblocks for database security group, _e.g._ `["10.0.1.0/24", "10.0.2.0/24]` 38 | - `rds_vpc_id` - VPC ID DB will be connected to 39 | - `allow_major_version_upgrade` - Allow upgrading of major version of database (eg. from Postgres 9.5.x to Postgres 9.6.x), default: false 40 | - `auto_minor_version_upgrade` - Automatically upgrade minor version of the DB (eg. from Postgres 9.5.3 to Postgres 9.5.4), default: true 41 | - `apply_immediately` - Specifies whether any database modifications are applied immediately, or during the next maintenance window, default: false 42 | - `maintenance_window` - The window to perform maintenance in. Syntax: 'ddd:hh24:mi-ddd:hh24:mi' UTC, default: "Mon:03:00-Mon:04:00" 43 | - `skip_final_snapshot` - if `true` (default), DB won't be backed up before deletion 44 | - `copy_tags_to_snapshot` - copy all tags from RDS database to snapshot (default `true`) 45 | - `backup_retention_period` - backup retention period in days (default: 0), must be `> 0` to enable backups 46 | - `backup_window` - when to perform DB snapshot, default "22:00-03:00"; can't overlap with maintenance window 47 | - `monitoring_interval` - To disable collecting Enhanced Monitoring metrics, specify 0. The default is 0. Valid Values: 0, 1, 5, 10, 15, 30, 60. 48 | - `tags` - A mapping of tags to assign to the DB instance 49 | 50 | ## Outputs 51 | 52 | - `rds_instance_id` - The ID of the RDS instance 53 | - `rds_instance_address` - The Address of the RDS instance 54 | - `subnet_group_id` - The ID of the Subnet Group 55 | 56 | ## Usage 57 | 58 | You can use these in your terraform template with the following steps. 59 | 60 | 1.) If you define subnets as follows (it's an example of one might do that) 61 | ``` 62 | resource "aws_subnet" "example" { 63 | count = "${length(var.availability_zones)}" 64 | 65 | vpc_id = "${aws_vpc.public.id}" 66 | cidr_block = "10.0.${count.index}.0/24" 67 | map_public_ip_on_launch = true 68 | 69 | availability_zone = "${var.region}${element(var.availability_zones, count.index)}" 70 | 71 | tags { 72 | Name = "${var.region}${element(var.availability_zones, count.index)}" 73 | } 74 | } 75 | ``` 76 | 77 | From `availability_zones` and `region` variables defined as follows: 78 | ``` 79 | 80 | variable "region" { 81 | type = "string" 82 | default = "eu-central-1" 83 | } 84 | 85 | variable "availability_zones" { 86 | type = "list" 87 | default = ["a", "b"] 88 | } 89 | ``` 90 | 91 | You will also need CIDR: 92 | ``` 93 | variable "private_cidr" { 94 | type = "list" 95 | default = ["10.0.0.0/16"] 96 | } 97 | ``` 98 | 99 | 2.) Adding a module resource to your template, e.g. `main.tf` 100 | 101 | ``` 102 | module "my_rds_instance" { 103 | source = "github.com/terraform-community-modules/tf_aws_rds" 104 | 105 | # RDS Instance Inputs 106 | rds_instance_identifier = "${var.rds_instance_identifier}" 107 | rds_allocated_storage = "${var.rds_allocated_storage}" 108 | rds_engine_type = "${var.rds_engine_type}" 109 | rds_instance_class = "${var.rds_instance_class}" 110 | rds_engine_version = "${var.rds_engine_version}" 111 | db_parameter_group = "${var.db_parameter_group}" 112 | 113 | database_name = "${var.database_name}" 114 | database_user = "${var.database_user}" 115 | database_password = "${var.database_password}" 116 | database_port = "${var.database_port}" 117 | 118 | # Upgrades 119 | allow_major_version_upgrade = "${var.allow_major_version_upgrade}" 120 | auto_minor_version_upgrade = "${var.auto_minor_version_upgrade}" 121 | 122 | apply_immediately = "${var.apply_immediately}" 123 | maintenance_window = "${var.maintenance_window}" 124 | 125 | # Snapshots and backups 126 | skip_final_snapshot = "${var.skip_final_snapshot}" 127 | copy_tags_to_snapshot = "${var.copy_tags_to_snapshot}" 128 | 129 | # DB Subnet Group Inputs 130 | subnets = ["${aws_subnet.example.*.id}"] # see above 131 | rds_vpc_id = "${module.vpc}" 132 | private_cidr = ["${var.private_cidr}"] 133 | 134 | tags { 135 | terraform = "true" 136 | env = "${terraform.env}" 137 | } 138 | } 139 | ``` 140 | 141 | 2.) Setting values for the following variables, either through `terraform.tfvars` or `-var` arguments on the CLI 142 | 143 | - `rds_instance_identifier` 144 | - `rds_is_multi_az` 145 | - `rds_storage_type` 146 | - `rds_iops` 147 | - `rds_allocated_storage` 148 | - `rds_engine_type` 149 | - `rds_engine_version` 150 | - `rds_instance_class` 151 | - `database_name` 152 | - `database_user` 153 | - `database_password` 154 | - `db_parameter_group` 155 | - `subnets` 156 | - `database_port` 157 | - `publicly_accessible` 158 | - `private_cidr` 159 | - `rds_vpc_id` 160 | - `allow_major_version_upgrade` 161 | - `auto_minor_version_upgrade` 162 | - `apply_immediately` 163 | - `maintenance_window` 164 | - `skip_final_snapshot` 165 | - `copy_tags_to_snapshot` 166 | - `backup_retention_period` 167 | - `backup_window` 168 | - `monitoring_interval` 169 | - `tags` 170 | 171 | # Maintainers 172 | 173 | * [Brandon Burton](https://github.com/solarce) (brandon@inatree.org) **Creator** 174 | * [Anton Babenko](https://github.com/antonbabenko) 175 | * [Steve Huff](https://github.com/hakamadare) 176 | 177 | # Contributors 178 | 179 | * [Grzegorz Adamowicz](https://github.com/gstlt) 180 | * [Trung Nguyen](https://github.com/trungnguyen) 181 | * [Marek Kwasecki](https://github.com/kwach) 182 | * [Kevin Duane](https://github.com/crackmac) 183 | * [Keith Grennan](https://github.com/keeth) 184 | * [Lee Provoost](https://github.com/leeprovoost) 185 | * Vikas Sakode 186 | * Carina Digital 187 | * [Bill Wang](https://github.com/ozbillwang) 188 | * [Robin Bowes](https://github.com/robinbowes) 189 | 190 | # License 191 | 192 | Apache 2 Licensed. See LICENSE for full details. 193 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------