Skip to content

Commit

Permalink
review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Byrne authored and hkantare committed Aug 29, 2023
1 parent 0854c34 commit f993e51
Show file tree
Hide file tree
Showing 17 changed files with 173 additions and 351 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,72 +142,6 @@ func DataSourceIBMAccountSettingsTemplateAssignment() *schema.Resource {
Computed: true,
Description: "Target account where the IAM resource is created.",
},
"profile": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Computed: true,
Description: "Policy Template Id, only returned for a profile assignment with policy references.",
},
"version": {
Type: schema.TypeString,
Computed: true,
Description: "Policy version, only returned for a profile assignment with policy references.",
},
"resource_created": {
Type: schema.TypeList,
Computed: true,
Description: "Body parameters for created resource.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Computed: true,
Description: "Id of the created resource.",
},
},
},
},
"error_message": {
Type: schema.TypeList,
Computed: true,
Description: "Body parameters for assignment error.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Computed: true,
Description: "Name of the error.",
},
"error_code": {
Type: schema.TypeString,
Computed: true,
Description: "Internal error code.",
},
"message": {
Type: schema.TypeString,
Computed: true,
Description: "Error message detailing the nature of the error.",
},
"status_code": {
Type: schema.TypeString,
Computed: true,
Description: "Internal status code for the error.",
},
},
},
},
"status": {
Type: schema.TypeString,
Computed: true,
Description: "Status for the target account's assignment.",
},
},
},
},
"account_settings": {
Type: schema.TypeList,
Computed: true,
Expand Down Expand Up @@ -274,73 +208,6 @@ func DataSourceIBMAccountSettingsTemplateAssignment() *schema.Resource {
},
},
},
"policy_template_refs": {
Type: schema.TypeList,
Computed: true,
Description: "Policy resource(s) included only for trusted profile assignments with policy references.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Computed: true,
Description: "Policy Template Id, only returned for a profile assignment with policy references.",
},
"version": {
Type: schema.TypeString,
Computed: true,
Description: "Policy version, only returned for a profile assignment with policy references.",
},
"resource_created": {
Type: schema.TypeList,
Computed: true,
Description: "Body parameters for created resource.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Computed: true,
Description: "Id of the created resource.",
},
},
},
},
"error_message": {
Type: schema.TypeList,
Computed: true,
Description: "Body parameters for assignment error.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Computed: true,
Description: "Name of the error.",
},
"error_code": {
Type: schema.TypeString,
Computed: true,
Description: "Internal error code.",
},
"message": {
Type: schema.TypeString,
Computed: true,
Description: "Error message detailing the nature of the error.",
},
"status_code": {
Type: schema.TypeString,
Computed: true,
Description: "Internal status code for the error.",
},
},
},
},
"status": {
Type: schema.TypeString,
Computed: true,
Description: "Status for the target account's assignment.",
},
},
},
},
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ func testAccCheckIBMAccountSettingsTemplateAssignmentDataSourceConfigBasic(name
template_version = ibm_iam_account_settings_template.account_settings_template.version
target_type = "Account"
target = "%s"
timeouts {
create = "5m"
}
}
data "ibm_iam_account_settings_template_assignment" "account_settings_template_assignment_instance" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,72 +208,6 @@ func DataSourceIBMTrustedProfileTemplateAssignment() *schema.Resource {
},
},
},
"account_settings": {
Type: schema.TypeList,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Computed: true,
Description: "Policy Template Id, only returned for a profile assignment with policy references.",
},
"version": {
Type: schema.TypeString,
Computed: true,
Description: "Policy version, only returned for a profile assignment with policy references.",
},
"resource_created": {
Type: schema.TypeList,
Computed: true,
Description: "Body parameters for created resource.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"id": {
Type: schema.TypeString,
Computed: true,
Description: "Id of the created resource.",
},
},
},
},
"error_message": {
Type: schema.TypeList,
Computed: true,
Description: "Body parameters for assignment error.",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Computed: true,
Description: "Name of the error.",
},
"error_code": {
Type: schema.TypeString,
Computed: true,
Description: "Internal error code.",
},
"message": {
Type: schema.TypeString,
Computed: true,
Description: "Error message detailing the nature of the error.",
},
"status_code": {
Type: schema.TypeString,
Computed: true,
Description: "Internal status code for the error.",
},
},
},
},
"status": {
Type: schema.TypeString,
Computed: true,
Description: "Status for the target account's assignment.",
},
},
},
},
"policy_template_refs": {
Type: schema.TypeList,
Computed: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ func testAccCheckIBMTrustedProfileTemplateAssignmentDataSourceConfigBasic(name s
depends_on = [
ibm_iam_trusted_profile_template.trusted_profile_template
]
timeouts {
create = "5m"
}
}
data "ibm_iam_trusted_profile_template_assignment" "trusted_profile_template_assignment_instance" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,22 @@ func ResourceIBMAccountSettingsTemplate() *schema.Resource {
Description: "ID of the account where the template resides.",
},
"name": {
Type: schema.TypeString,
Optional: true,
Description: "The name of the trusted profile template. This is visible only in the enterprise account.",
Type: schema.TypeString,
AtLeastOneOf: []string{"name", "description", "account_settings"},
Optional: true,
Description: "The name of the trusted profile template. This is visible only in the enterprise account.",
},
"description": {
Type: schema.TypeString,
Optional: true,
Description: "The description of the trusted profile template. Describe the template for enterprise account users.",
Type: schema.TypeString,
AtLeastOneOf: []string{"name", "description", "account_settings"},
Optional: true,
Description: "The description of the trusted profile template. Describe the template for enterprise account users.",
},
"account_settings": {
Type: schema.TypeList,
MaxItems: 1,
Optional: true,
Type: schema.TypeList,
AtLeastOneOf: []string{"name", "description", "account_settings"},
MaxItems: 1,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"restrict_create_service_id": {
Expand Down Expand Up @@ -145,33 +148,33 @@ func ResourceIBMAccountSettingsTemplate() *schema.Resource {
Schema: map[string]*schema.Schema{
"timestamp": {
Type: schema.TypeString,
Required: true,
Computed: true,
Description: "Timestamp when the action was triggered.",
},
"iam_id": {
Type: schema.TypeString,
Required: true,
Computed: true,
Description: "IAM ID of the identity which triggered the action.",
},
"iam_id_account": {
Type: schema.TypeString,
Required: true,
Computed: true,
Description: "Account of the identity which triggered the action.",
},
"action": {
Type: schema.TypeString,
Required: true,
Computed: true,
Description: "Action of the history entry.",
},
"params": {
Type: schema.TypeList,
Required: true,
Computed: true,
Description: "Params of the history entry.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"message": {
Type: schema.TypeString,
Required: true,
Computed: true,
Description: "Message which summarizes the executed action.",
},
},
Expand Down
Loading

0 comments on commit f993e51

Please sign in to comment.