Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(IAM Identity): Effective account settings #5583

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions examples/ibm-iam-identity-effective-account-settings/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Examples for IAM Identity Services

These examples illustrate how to use the resources and data sources associated with IAM Identity Services.

The following data sources are supported:
* ibm_iam_effective_account_settings

## Usage

To run this example, execute the following commands:

```bash
$ terraform init
$ terraform plan
$ terraform apply
```

Run `terraform destroy` when you don't need these resources.

## IAM Identity Services data sources

### Data source: ibm_iam_effective_account_settings

```hcl
data "ibm_iam_effective_account_settings" "iam_effective_account_settings_instance" {
account_id = var.iam_effective_account_settings_account_id
include_history = var.iam_effective_account_settings_include_history
resolve_user_mfa = var.iam_effective_account_settings_resolve_user_mfa
}
```

#### Inputs

| Name | Description | Type | Required |
|------|-------------|------|---------|
| account_id | Unique ID of the account. | `string` | true |
| include_history | Defines if the entity history is included in the response. | `bool` | false |
| resolve_user_mfa | Enrich MFA exemptions with user information. | `bool` | false |

#### Outputs

| Name | Description |
|------|-------------|
| context | Context with key properties for problem determination. |
| effective | |
| account | |
| assigned_templates | assigned template section. |

## Assumptions

1. TODO

## Notes

1. TODO

## Requirements

| Name | Version |
|------|---------|
| terraform | ~> 0.12 |

## Providers

| Name | Version |
|------|---------|
| ibm | 1.13.1 |
14 changes: 14 additions & 0 deletions examples/ibm-iam-identity-effective-account-settings/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
provider "ibm" {
ibmcloud_api_key = var.ibmcloud_api_key
}

// Data source is not linked to a resource instance
// Uncomment if an existing data source instance exists
/*
// Create iam_effective_account_settings data source
data "ibm_iam_effective_account_settings" "iam_effective_account_settings_instance" {
account_id = var.iam_effective_account_settings_account_id
include_history = var.iam_effective_account_settings_include_history
resolve_user_mfa = var.iam_effective_account_settings_resolve_user_mfa
}
*/
Empty file.
21 changes: 21 additions & 0 deletions examples/ibm-iam-identity-effective-account-settings/variables.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
variable "ibmcloud_api_key" {
description = "IBM Cloud API key"
type = string
}

// Data source arguments for iam_effective_account_settings
variable "iam_effective_account_settings_account_id" {
description = "Unique ID of the account."
type = string
default = "account_id"
}
variable "iam_effective_account_settings_include_history" {
description = "Defines if the entity history is included in the response."
type = bool
default = false
}
variable "iam_effective_account_settings_resolve_user_mfa" {
description = "Enrich MFA exemptions with user information."
type = bool
default = false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
terraform {
required_version = ">= 1.0"
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "1.52.0-beta0"
}
}
}
1 change: 1 addition & 0 deletions ibm/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ func Provider() *schema.Provider {
"ibm_iam_access_group_template_versions": iamaccessgroup.DataSourceIBMIAMAccessGroupTemplateVersions(),
"ibm_iam_access_group_template_assignment": iamaccessgroup.DataSourceIBMIAMAccessGroupTemplateAssignment(),
"ibm_iam_account_settings": iamidentity.DataSourceIBMIAMAccountSettings(),
"ibm_iam_effective_account_settings": iamidentity.DataSourceIBMIamEffectiveAccountSettings(),
"ibm_iam_auth_token": iamidentity.DataSourceIBMIAMAuthToken(),
"ibm_iam_role_actions": iampolicy.DataSourceIBMIAMRoleAction(),
"ibm_iam_users": iamidentity.DataSourceIBMIAMUsers(),
Expand Down
Loading
Loading