From 565f0a4e0f4c502d3098b852fdd38f09bc2d4a7a Mon Sep 17 00:00:00 2001 From: Dominik-K Date: Thu, 20 Apr 2017 22:02:48 +0200 Subject: [PATCH] `roles` deprecated in docs & code error message (#13622) --- .../providers/aws/resource_aws_iam_instance_profile.go | 2 +- .../providers/aws/r/iam_instance_profile.html.markdown | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/builtin/providers/aws/resource_aws_iam_instance_profile.go b/builtin/providers/aws/resource_aws_iam_instance_profile.go index 8e1d2d68e..930ab3b39 100644 --- a/builtin/providers/aws/resource_aws_iam_instance_profile.go +++ b/builtin/providers/aws/resource_aws_iam_instance_profile.go @@ -121,7 +121,7 @@ func resourceAwsIamInstanceProfileCreate(d *schema.ResourceData, meta interface{ _, hasRole := d.GetOk("role") if hasRole == false && hasRoles == false { - return fmt.Errorf("Either `roles` or `role` must be specified when creating an IAM Instance Profile") + return fmt.Errorf("Either `role` or `roles` (deprecated) must be specified when creating an IAM Instance Profile") } request := &iam.CreateInstanceProfileInput{ diff --git a/website/source/docs/providers/aws/r/iam_instance_profile.html.markdown b/website/source/docs/providers/aws/r/iam_instance_profile.html.markdown index 24b522b32..cc7371acb 100644 --- a/website/source/docs/providers/aws/r/iam_instance_profile.html.markdown +++ b/website/source/docs/providers/aws/r/iam_instance_profile.html.markdown @@ -10,7 +10,7 @@ description: |- Provides an IAM instance profile. -~> **NOTE:** Either `roles` or `role` must be specified in the IAM Instance Profile. +~> **NOTE:** Either `role` or `roles` (**deprecated**) must be specified. ## Example Usage @@ -49,7 +49,9 @@ The following arguments are supported: * `name` - (Optional, Forces new resource) The profile's name. If omitted, Terraform will assign a random, unique name. * `name_prefix` - (Optional, Forces new resource) Creates a unique name beginning with the specified prefix. Conflicts with `name`. * `path` - (Optional, default "/") Path in which to create the profile. -* `roles` - (Optional) A list of role names to include in the profile. The current default is 1. If you see an error message similar to `Cannot exceed quota for InstanceSessionsPerInstanceProfile: 1`, then you must contact AWS support and ask for a limit increase. `WARNING: This will be deprecated in a future version of Terraform`. +* `roles` - (**Deprecated**) +A list of role names to include in the profile. The current default is 1. If you see an error message similar to `Cannot exceed quota for InstanceSessionsPerInstanceProfile: 1`, then you must contact AWS support and ask for a limit increase. + WARNING: This is deprecated since [version 0.9.3 (April 12, 2017)](https://github.com/hashicorp/terraform/blob/master/CHANGELOG.md#093-april-12-2017), as >= 2 roles are not possible. See [issue #11575](https://github.com/hashicorp/terraform/issues/11575). * `role` - (Optional) The role name to include in the profile. ## Attribute Reference @@ -59,8 +61,8 @@ The following arguments are supported: * `create_date` - The creation timestamp of the instance profile. * `name` - The instance profile's name. * `path` - The path of the instance profile in IAM. -* `roles` - The list of roles assigned to the instance profile. -* `role` - The role assigned to the instance profile +* `role` - The role assigned to the instance profile. +* `roles` - The list of roles assigned to the instance profile. (**Deprecated**) * `unique_id` - The [unique ID][1] assigned by AWS. [1]: https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html#GUIDs