Skip to content

Commit

Permalink
IAM Identity: Effective account settings (IBM-Cloud#5583)
Browse files Browse the repository at this point in the history
  • Loading branch information
pooraniss-ibm authored Nov 25, 2024
1 parent 7a2b13c commit 4854242
Show file tree
Hide file tree
Showing 9 changed files with 1,320 additions and 0 deletions.
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 @@ -373,6 +373,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

0 comments on commit 4854242

Please sign in to comment.