Skip to content

Commit

Permalink
Docs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Petriv committed Jul 25, 2021
1 parent f915e1f commit 559a9ba
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 2 deletions.
62 changes: 62 additions & 0 deletions docs/data-sources/siteshield_map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
layout: "akamai"
page_title: "Akamai: Site Shield"
subcategory: "Site Shield Maps"
description: |-
Site Shield
---

# akamai_akamai_siteshield_map

Use the `akamai_akamai_siteshield_map` data source to retrieve information about the Site Shield maps, filtered by map ID. The information available is described
[here](https://developer.akamai.com/api/cloud_security/site_shield/v1.html#getamap).

## Example Usage

Basic usage:

```hcl
provider "akamai" {
edgerc = "~/.edgerc"
}
data "akamai_siteshield_map" "siteshield" {
map_id = 1234
}
output "siteshield_current_cidrs" {
value = data.akamai_siteshield_map.siteshield.current_cidrs
}
output "siteshield_proposed_cidrs" {
value = data.akamai_siteshield_map.siteshield.proposed_cidrs
}
output "siteshield_rule_name" {
value = data.akamai_siteshield_map.siteshield.rule_name
}
output "siteshield_acknowledged" {
value = data.akamai_siteshield_map.siteshield.acknowledged
}
```

## Argument Reference

* `map_id` - (Required) The map ID of a specific Site Shield map to retrieve.

The following arguments are supported:

## Attributes Reference

In addition to the arguments above, the following attributes are exported:

* `current_cidrs` - A list of current CIDRs configured for the specified SS map.

* `proposed_cidrs` - A list of proposed (new) CIDRs configured for the specified SS map.

* `rule_name` - A map rule name available shown in properties.

* `acknowledged` - A boolean of the aknowledgement state of the map.

2 changes: 1 addition & 1 deletion docs/guides/akamai_provider_auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ supporting API service names:
| **Identity and Access Management** | Identity Management: User Administration |
| **Network Lists** | Network Lists |
| **Property Provisioning** (Includes Common functions) | Property Manager (PAPI) |

| **Site Shield Maps** | Site Shield Maps |

-> **Note:** If you're using the Edge DNS or GTM module, you may also need the Property Manager API service. Whether you need this additional service depends on your contract and group. See [PAPI concepts](https://developer.akamai.com/api/core_features/property_manager/v1.html#papiconcepts) for more information.

Expand Down
2 changes: 2 additions & 0 deletions docs/guides/get_started_provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ At this point in the setup, you should refer to the guides for the Akamai module
| **Identity and Access Management** | [Identity and Access Management Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_iam) |
| **Network Lists** | [Network Lists Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_networklists) |
| **Property Provisioning** | [Property Provisioning Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_property) |
| **Site Shield Maps** | [Site Shield Maps Module Guide](https://registry.terraform.io/providers/akamai/akamai/latest/docs/guides/get_started_siteshield) |


-> **Note** Both Terraform and the Akamai Terraform CLI package come
pre-installed in the Akamai Development Environment. See [Set Up a Development Environment](https://developer.akamai.com/blog/2020/05/26/set-development-environment) for more information.
Expand Down
71 changes: 71 additions & 0 deletions docs/guides/get_started_siteshield.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
layout: "akamai"
page_title: "Module: Site Shield Maps"
description: |-
Site Shield Maps module for the Akamai Terraform Provider
---

# Site Shield Maps Module Guide

The Akamai Site Shield Maps provider for Terraform gives you the ability to automate the retrieval of Site Shield maps used in various Akamai products. For customers who are already using the Akamai Network, Site Shield provides an additional layer of protection that helps prevent attackers from bypassing cloud-based protections to target the application origin. Site Shield cloaks websites and applications from the public Internet and restricts clients from directly accessing the origin. It is designed to complement the existing network infrastructure as well as advanced cloud security technologies available on the globally-distributed Akamai Intelligent Platform to mitigate the risks associated with network and application-layer threats that directly target the origin infrastructure. For more information about Site Shield Maps, see the [API documentation](https://developer.akamai.com/api/cloud_security/site_shield/v1.html)

## Configure the Terraform Provider

Set up your .edgerc credential files as described in [Get Started with Akamai APIs](https://developer.akamai.com/api/getting-started), and include read-write permissions for the Network Lists API.

1. Create a new folder called `terraform`
1. Inside the new folder, create a new file called `akamai.tf`.
1. Add the provider configuration to your `akamai.tf` file:

```hcl
provider "akamai" {
edgerc = "~/.edgerc"
config_section = "siteshield"
}
```

## Prerequisites

Review [Get Started with APIs](https://learn.akamai.com/en-us/learn_akamai/getting_started_with_akamai_developers/developer_tools/getstartedapis.html) for details on how to set up client tokens to access any Akamai API. These tokens appear as custom hostnames that look like this: https://akzz-XXXXXXXXXXXXXXXX-XXXXXXXXXXXXXXXX.luna.akamaiapis.net.

To enable this API, choose the API service named Network Lists, and set the access level to READ-WRITE.

## Retrieving Site Shield Map Information

You can obtain a list of all network lists available for an authenticated user belonging to a group using the [`akamai_siteshield_map`](../data-sources/siteshield_map.md) data source and its `output_text` attribute. Add the following to your `akamai.tf` file:

```hcl
data "akamai_siteshield_map" "siteshield" {
map_id = 1234
}
output "siteshield_proposed_cidrs" {
value = data.akamai_siteshield_map.siteshield.proposed_cidrs
}
```

Once you have saved the file, switch to the terminal and initialize Terraform using the command:

```bash
$ terraform init
```

This command will install the latest version of the Akamai provider, as well as any other providers necessary. To update the Akamai provider version after a new release, simply run `terraform init` again.

## Test Your Configuration

To test your configuration, use `terraform plan`:

```bash
$ terraform plan
```

This command will make Terraform create a plan for the work it will do based on the configuration file. This will not actually make any changes and is safe to run as many times as you like.

## Apply Changes

To actually display the configuration information, or to create or modify resources as described further in this guide, we need to instruct Terraform to `apply` the changes outlined in the plan. To do this, in the terminal, run the command:

```bash
$ terraform apply
```
2 changes: 1 addition & 1 deletion pkg/providers/siteshield/data_akamai_siteshield_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func dataSourceSiteShieldMap() *schema.Resource {
Schema: map[string]*schema.Schema{
"map_id": {
Type: schema.TypeInt,
Optional: true,
Required: true,
},
"current_cidrs": {
Type: schema.TypeList,
Expand Down

0 comments on commit 559a9ba

Please sign in to comment.