-
Notifications
You must be signed in to change notification settings - Fork 631
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a58a345
commit 5bd631a
Showing
5 changed files
with
170 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -54,6 +54,44 @@ resource "cloudflare_access_policy" "test_policy" { | |
ip = [var.office_ip] | ||
} | ||
} | ||
# Access policy for an infrastructure application | ||
resource "cloudflare_access_policy" "infra-app-example-allow" { | ||
application_id = cloudflare_zero_trust_access_application.infra-app-example.id | ||
account_id = "0da42c8d2132a9ddaf714f9e7c920711" | ||
name = "infra-app-example-allow" | ||
decision = "allow" | ||
precedence = 1 | ||
include { | ||
email = ["[email protected]"] | ||
} | ||
connection_rules { | ||
ssh { | ||
usernames = ["ec2-user"] | ||
} | ||
} | ||
} | ||
# Infrastructure application configuration for infra-app-example-allow | ||
resource "cloudflare_zero_trust_access_application" "infra-app-example" { | ||
account_id = "0da42c8d2132a9ddaf714f9e7c920711" | ||
name = "infra-app" | ||
type = "infrastructure" | ||
target_criteria { | ||
port = 22 | ||
protocol = "SSH" | ||
target_attributes { | ||
name = "hostname" | ||
values = ["tfgo-tests-useast", "tfgo-tests-uswest"] | ||
} | ||
} | ||
# specify existing access policies by id | ||
policies = [] | ||
} | ||
``` | ||
<!-- schema generated by tfplugindocs --> | ||
## Schema | ||
|
@@ -70,6 +108,7 @@ resource "cloudflare_access_policy" "test_policy" { | |
- `application_id` (String) The ID of the application the policy is associated with. Required when using `precedence`. **Modifying this attribute will force creation of a new resource.** | ||
- `approval_group` (Block List) (see [below for nested schema](#nestedblock--approval_group)) | ||
- `approval_required` (Boolean) | ||
- `connection_rules` (Block List, Max: 1) The rules that define how users may connect to the targets secured by your application. (see [below for nested schema](#nestedblock--connection_rules)) | ||
- `exclude` (Block List) A series of access conditions, see [Access Groups](https://registry.terraform.io/providers/cloudflare/cloudflare/latest/docs/resources/access_group#conditions). (see [below for nested schema](#nestedblock--exclude)) | ||
- `isolation_required` (Boolean) Require this application to be served in an isolated browser for users matching this policy. | ||
- `precedence` (Number) The unique precedence for policies on a single application. Required when using `application_id`. | ||
|
@@ -192,6 +231,22 @@ Optional: | |
- `email_list_uuid` (String) | ||
|
||
|
||
<a id="nestedblock--connection_rules"></a> | ||
### Nested Schema for `connection_rules` | ||
|
||
Required: | ||
|
||
- `ssh` (Block List, Min: 1, Max: 1) The SSH-specific rules that define how users may connect to the targets secured by your application. (see [below for nested schema](#nestedblock--connection_rules--ssh)) | ||
|
||
<a id="nestedblock--connection_rules--ssh"></a> | ||
### Nested Schema for `connection_rules.ssh` | ||
|
||
Required: | ||
|
||
- `usernames` (List of String) Contains the Unix usernames that may be used when connecting over SSH. | ||
|
||
|
||
|
||
<a id="nestedblock--exclude"></a> | ||
### Nested Schema for `exclude` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters