Skip to content

Commit

Permalink
updated Markdown generated from tfplugindocs
Browse files Browse the repository at this point in the history
  • Loading branch information
Integralist committed Jan 26, 2021
1 parent 7776fc2 commit 00f2482
Show file tree
Hide file tree
Showing 10 changed files with 1,501 additions and 2,936 deletions.
39 changes: 15 additions & 24 deletions docs/data-sources/ip_ranges.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,27 @@
---
layout: "fastly"
page_title: "Fastly: fastly_ip_ranges"
sidebar_current: "docs-fastly-datasource-ip_ranges"
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "fastly_ip_ranges Data Source - terraform-provider-fastly"
subcategory: ""
description: |-
Get information on Fastly IP ranges.
---

# fastly_ip_ranges
# Data Source `fastly_ip_ranges`

Use this data source to get the [IP ranges][1] of Fastly edge nodes.

## Example Usage

```hcl
data "fastly_ip_ranges" "fastly" {}

resource "aws_security_group" "from_fastly" {
name = "from_fastly"

ingress {
from_port = "443"
to_port = "443"
protocol = "tcp"
cidr_blocks = ["${data.fastly_ip_ranges.fastly.cidr_blocks}"]
ipv6_cidr_blocks = ["${data.fastly_ip_ranges.fastly.ipv6_cidr_blocks}"]
}
}
```
<!-- schema generated by tfplugindocs -->
## Schema

## Attributes Reference
### Optional

- **id** (String) The ID of this resource.

### Read-only

- **cidr_blocks** (List of String)
- **ipv6_cidr_blocks** (List of String)

* `cidr_blocks` - The lexically ordered list of ipv4 CIDR blocks.
* `ipv6_cidr_blocks` - The lexically ordered list of ipv6 CIDR blocks.

[1]: https://docs.fastly.com/guides/securing-communications/accessing-fastlys-ip-ranges
150 changes: 20 additions & 130 deletions docs/data-sources/waf_rules.md
Original file line number Diff line number Diff line change
@@ -1,148 +1,38 @@
---
layout: "fastly"
page_title: "Fastly: fastly_waf_rules"
sidebar_current: "docs-fastly-datasource-waf_rules"
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "fastly_waf_rules Data Source - terraform-provider-fastly"
subcategory: ""
description: |-
Get information on Fastly WAF rules.
---

-> **Note:** This data source is only available from 0.20.0 of the Fastly terraform provider.
# Data Source `fastly_waf_rules`

# fastly_waf_rules

Use this data source to get the [WAF rules][1] of Fastly. A set of third-party rules from the OWASP Core Ruleset, commercial sources, and open source, in addition to Fastly-generated rules.
They offer protection from injection attacks and cross site scripting amongst other key application-layer attacks.

## Example Usage

Usage with publishers Filter:

```hcl
data "fastly_waf_rules" "owasp" {
publishers = ["owasp"]
}
```
<!-- schema generated by tfplugindocs -->
## Schema

Usage with tags filter:
### Optional

```hcl
data "fastly_waf_rules" "tag" {
tags = ["language-html", "language-jsp"]
}
```
- **exclude_modsec_rule_ids** (List of Number) A list of modsecurity rules IDs to be excluded from the data set.
- **id** (String) The ID of this resource.
- **publishers** (List of String) A list of publishers to be used as filters for the data set.
- **tags** (List of String) A list of tags to be used as filters for the data set.

Usage with exclude filter:
### Read-only

```hcl
data "fastly_waf_rules" "owasp_with_exclusions" {
publishers = ["owasp"]
exclude_modsec_rule_ids = [1010090]
}
```
- **rules** (List of Object) The list of rules that results from any given combination of filters. (see [below for nested schema](#nestedatt--rules))

Usage without filters:
<a id="nestedatt--rules"></a>
### Nested Schema for `rules`

```hcl
data "fastly_waf_rules" "all" {
# This will retrieve the entire list of rules available from the API at the time.
}
```
Read-only:

Usage with WAF configuration resource:
- **latest_revision_number** (Number)
- **modsec_rule_id** (Number)
- **type** (String)

```hcl
variable "type_status" {
type = map(string)
default = {
score = "score"
threshold = "log"
strict = "log"
}
}

resource "fastly_service_v1" "demo" {
name = "demofastly"
domain {
name = "example.com"
comment = "demo"
}
backend {
address = "127.0.0.1"
name = "origin1"
port = 80
}
condition {
name = "WAF_Prefetch"
type = "PREFETCH"
statement = "req.backend.is_origin"
}
# This condition will always be false
# adding it to the response object created below
# prevents Fastly from returning a 403 on all of your traffic.
condition {
name = "WAF_always_false"
statement = "false"
type = "REQUEST"
}
response_object {
name = "WAF_Response"
status = "403"
response = "Forbidden"
content_type = "text/html"
content = "<html><body>Forbidden</body></html>"
request_condition = "WAF_always_false"
}
waf {
prefetch_condition = "WAF_Prefetch"
response_object = "WAF_Response"
}
force_destroy = true
}
data "fastly_waf_rules" "owasp" {
publishers = ["owasp"]
}
resource "fastly_service_waf_configuration" "waf" {
waf_id = fastly_service_v1.demo.waf[0].waf_id
http_violation_score_threshold = 100
dynamic "rule" {
for_each = data.fastly_waf_rules.owasp.rules
content {
modsec_rule_id = rule.value.modsec_rule_id
revision = rule.value.latest_revision_number
status = lookup(var.type_status, rule.value.type, "log")
}
}
}
```

## Argument Reference

~> **Warning:** The data source's filters are applied using an **AND** boolean operator, so depending on the combination of filters, they may become mutually exclusive.

* `publishers` - Inclusion filter by WAF rule's publishers.
* `tags` - Inclusion filter by WAF rule's tags.
* `exclude_modsec_rule_ids` - Exclusion filter by WAF rule's ModSecurity ID.

## Attribute Reference

* `rules` - The Web Application Firewall's rules result set.

~> **Warning:** Deprecated rules will not be present on this data source's result set.

The `rules` block supports:

* `modsec_rule_id` - The rule's modsecurity ID.
* `latest_revision_number` - The rule's latest revision.
* `type` - The rule's type.

[1]: https://developer.fastly.com/reference/api/waf/rules/
95 changes: 10 additions & 85 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,96 +1,21 @@
---
layout: "fastly"
page_title: "Provider: Fastly"
sidebar_current: "docs-fastly-index"
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "fastly Provider"
subcategory: ""
description: |-
Fastly
---

# Fastly Provider
# fastly Provider

The Fastly provider is used to interact with the content delivery network (CDN)
provided by Fastly.

In order to use this Provider, you must have an active account with Fastly.
Pricing and signup information can be found at https://www.fastly.com/signup

Use the navigation to the left to read about the available resources.

The Fastly provider prior to version v0.13.0 requires using
[--parallelism=1](/docs/commands/apply.html#parallelism-n) for `apply` operations.

## Example Usage
<!-- schema generated by tfplugindocs -->
## Schema

```hcl
# Configure the Fastly Provider
provider "fastly" {
api_key = "test"
}
### Optional

# Create a Service
resource "fastly_service_v1" "myservice" {
name = "myawesometestservice"
# ...
}
```

## Authentication

The Fastly provider offers an API key based method of providing credentials for
authentication. The following methods are supported, in this order, and
explained below:

- Static API key
- Environment variables


### Static API Key

Static credentials can be provided by adding a `api_key` in-line in the
Fastly provider block:

Usage:

```hcl
provider "fastly" {
api_key = "test"
}
resource "fastly_service_v1" "myservice" {
# ...
}
```

You can create a credential on the Personal API Tokens page: https://manage.fastly.com/account/personal/tokens

### Environment variables

You can provide your API key via `FASTLY_API_KEY` environment variable,
representing your Fastly API key. When using this method, you may omit the
Fastly `provider` block entirely:

```hcl
resource "fastly_service_v1" "myservice" {
# ...
}
```

Usage:

```
$ export FASTLY_API_KEY="afastlyapikey"
$ terraform plan
```

## Argument Reference

The following arguments are supported in the `provider` block:

* `api_key` - (Optional) This is the API key. It must be provided, but
it can also be sourced from the `FASTLY_API_KEY` environment variable

* `base_url` - (Optional) This is the API server hostname. It is required
if using a private instance of the API and otherwise defaults to the
public Fastly production service. It can also be sourced from the
`FASTLY_API_URL` environment variable
- **api_key** (String) Fastly API Key from https://app.fastly.com/#account
- **base_url** (String) Fastly API URL
Loading

0 comments on commit 00f2482

Please sign in to comment.