Skip to content

Commit

Permalink
add links to aws, azure, and registry functions docs
Browse files Browse the repository at this point in the history
  • Loading branch information
rberlind committed Jan 27, 2022
1 parent fab8153 commit 8a8c0ea
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion aws/aws-functions/docs/determine_role_arn.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# determine_role_arn
# [determine_role_arn](../aws-functions.sentinel#L25)
This function determines the ARN of an AWS IAM role assumed by the Terraform AWS provider using the [tfconfig/v2](https://www.terraform.io/docs/cloud/sentinel/import/tfconfig-v2.html) and [tfplan/v2](https://www.terraform.io/docs/cloud/sentinel/import/tfplan-v2.html) imports.

It can only do this when the `role_arn` of the AWS provider is set to a hard-coded string or to a variable within the Terraform configuration. In the second case, the function cross-references the name of the variable in the tfconfig/v2 import with the actual value assigned to it in the tfplan/v2 import.
Expand Down
2 changes: 1 addition & 1 deletion aws/aws-functions/docs/filter_providers_by_regions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# filter_providers_by_regions
# [filter_providers_by_regions](../aws-functions.sentinel#L161)

This function filters instances of the AWS provider to those in a specific region using the tfconfig/v2 and tfplan/v2 imports.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# find_resources_with_standard_tags
# [find_resources_with_standard_tags](../aws-functions.sentinel#L12)
This function finds all AWS resource instances of specified types in the current plan that are not being permanently deleted using the [tfplan/v2](https://www.terraform.io/docs/cloud/sentinel/import/tfplan-v2.html) import.

It was updated on 9/29/2020 to work with both the short name of the AWS provider, "aws", and fully-qualfied provider names that match the regex, `(.*)aws$`. This was required because Terraform 0.13 and above returns the fully-qualified names of providers such as "registry.terraform.io/hashicorp/aws" to Sentinel. Older versions of Terraform only return the short-form such as "aws".
Expand Down
2 changes: 1 addition & 1 deletion aws/aws-functions/docs/get_assumed_roles.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# get_assumed_roles
# [get_assumed_roles](../aws-functions.sentinel#L80)
This function gets all roles assumed by any instances of the AWS provider in the current Terraform configuration using the [tfconfig/v2](https://www.terraform.io/docs/cloud/sentinel/import/tfconfig-v2.html) and [tfplan/v2](https://www.terraform.io/docs/cloud/sentinel/import/tfplan-v2.html) imports.

The tfplan/v2 import is used by the `determine_role_arn` function that this function calls.
Expand Down
2 changes: 1 addition & 1 deletion aws/aws-functions/docs/validate_assumed_roles_with_list.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# validate_assumed_roles_with_list
# [validate_assumed_roles_with_list](../aws-functions.sentinel#L101)
This function checks whether all roles assumed by all instances of the AWS provider in the current Terraform configuration are in a specified list.

## Sentinel Module
Expand Down
2 changes: 1 addition & 1 deletion aws/aws-functions/docs/validate_assumed_roles_with_map.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# validate_assumed_roles_with_map
# [validate_assumed_roles_with_map](../aws-functions.sentinel#L123)
This function validates whether all roles assumed by instances of the AWS provider are allowed for the current workspace based on a map that maps AWS IAM roles to regular expressions (regex) that are compared to the name of the workspace.

## Sentinel Module
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# validate_provider_in_allowed_regions
# [validate_provider_in_allowed_regions](../aws-functions.sentinel#L218)
This function validates whether a specific instance of the AWS provider is in a list of regions. The provider instance should be derived from `tfconfig.providers` or from the `provider_config_key` of a resource derived from `tfconfig.resources`.

It attempts to identify the region of the provider aliases in several ways including constant values assigned to their `region` argument and resolution of references to variables. It first tries to process references to variables as strings, then as maps with a key called "region". It handles references to variables in the root module by using tfplan.variables. It handles references to variables in non-root modules by examining the module call from the current module's parent.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# find_resources_with_standard_tags
# [find_resources_with_standard_tags](../azure-functions.sentinel#L8)
This function finds all Azure resource instances of specified types in the current plan that are not being permanently deleted using the [tfplan/v2](https://www.terraform.io/docs/cloud/sentinel/import/tfplan-v2.html) import.

This function works with both the short name of the Azure provider, "azurerm", and fully-qualfied provider names that match the regex, `(.*)azurerm$`. The latter is required because Terraform 0.13 and above returns the fully-qualified names of providers such as "registry.terraform.io/hashicorp/azurerm" to Sentinel. Older versions of Terraform only return the short-form such as "azurerm".
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# find_most_recent_version
# [find_most_recent_version](../registry-functions.sentinel#L98)
This function finds the most recent version from a map of version strings. The `versions` parameter should contain strings, not actual versions from the version import. The keys of the map should be integers ranging from 0 to N-1 where the map has N versions.

It is needed since lists of versions returned by the [Registry Modules API](https://www.terraform.io/docs/cloud/api/modules.html) endpoints are not ordered.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# get_recent_module_versions
# [get_recent_module_versions](../registry-functions.sentinel#L11)
This function gets recent versions for private or public modules from a private module registry (PMR). It calls the `get_recent_module_versions_by_page` function which gets those versions one page at a time. It has the same arguments as that function except for the `page` argument.

## Sentinel Module
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# get_recent_module_versions_by_page
# [get_recent_module_versions_by_page](../registry-functions.sentinel#L26)
This function gets recent versions for private or public modules from a private module registry (PMR) one page at a time. It is called by the [get_recent_module_versions](./get_recent_module_versions.md) function.

It calls itself recursively, incrementing the `page` parameter by one until there are no more pages. We use two separate functions to keep the public interface of the `get_recent_module_versions` function cleaner.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# is_module_in_public_registry
# [is_module_in_public_registry](../registry-functions.sentinel#L122)
This function determines if a module is in the public registry.

## Sentinel Module
Expand Down Expand Up @@ -31,4 +31,4 @@ if uncurated_public_module {
}
```

This function is called by the [use-recent-versions-from-pmr.sentinel](../../use-recent-versions-from-pmr.sentinel) policy. In fact, the above code is based on code from that policy.
This function is called by the [use-recent-versions-from-pmr.sentinel](../../use-recent-versions-from-pmr.sentinel) policy. In fact, the above code is based on code from that policy.

0 comments on commit 8a8c0ea

Please sign in to comment.