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

add create_date as an attribute to aws_iam_instance_profile resource #4932

Merged
merged 1 commit into from
Jun 22, 2018

Conversation

bootswithdefer
Copy link
Contributor

Fixes #3527

Changes proposed in this pull request:

  • Add create_date as an attribute to aws_iam_instance_profile resource. The documentation already states the attribute is available.

Acceptance testing not run. Manually tested on an existing instance profile in my environment.

@ghost ghost added the size/XS Managed by automation to categorize the size of a PR. label Jun 21, 2018
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/iam Issues and PRs that pertain to the iam service. labels Jun 21, 2018
@@ -307,6 +307,9 @@ func instanceProfileReadResult(d *schema.ResourceData, result *iam.InstanceProfi
if err := d.Set("arn", result.Arn); err != nil {
return err
}
if err := d.Set("create_date", result.CreateDate); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bootswithdefer the *time.Time value needs to be turned into a string:

=== RUN   TestAccAWSIAMInstanceProfile_basic
--- FAIL: TestAccAWSIAMInstanceProfile_basic (4.90s)
    testing.go:518: Step 0 error: Error applying: 1 error(s) occurred:
        
        * aws_iam_instance_profile.test: 1 error(s) occurred:
        
        * aws_iam_instance_profile.test: Error creating IAM instance profile test: create_date: '' expected type 'string', got unconvertible type '*time.Time'

e.g. result.CreateDate.Format(time.RFC3339)

@bootswithdefer bootswithdefer force-pushed the instance-profile-create-date branch from 17eaa86 to f4be339 Compare June 22, 2018 00:53
@ghost ghost added the size/XS Managed by automation to categorize the size of a PR. label Jun 22, 2018
@bootswithdefer
Copy link
Contributor Author

Fixed. Also got my acceptance testing environment set up.

$ make testacc TESTARGS='-run=TestAccAWSIAMInstanceProfile_basic'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./... -v -run=TestAccAWSIAMInstanceProfile_basic -timeout 120m
?   	github.com/terraform-providers/terraform-provider-aws	[no test files]
=== RUN   TestAccAWSIAMInstanceProfile_basic
--- PASS: TestAccAWSIAMInstanceProfile_basic (16.47s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	16.498s

@bflad bflad added this to the v1.25.0 milestone Jun 22, 2018
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great @bootswithdefer! 🚀

(For those curious about such the small change, the attribute was already defined in the schema and in the documentation)

5 tests passed (all tests)
=== RUN   TestAccAWSIAMInstanceProfile_missingRoleThrowsError
--- PASS: TestAccAWSIAMInstanceProfile_missingRoleThrowsError (2.71s)
=== RUN   TestAccAWSIAMInstanceProfile_basic
--- PASS: TestAccAWSIAMInstanceProfile_basic (11.23s)
=== RUN   TestAccAWSIAMInstanceProfile_withRoleNotRoles
--- PASS: TestAccAWSIAMInstanceProfile_withRoleNotRoles (11.53s)
=== RUN   TestAccAWSIAMInstanceProfile_namePrefix
--- PASS: TestAccAWSIAMInstanceProfile_namePrefix (12.00s)
=== RUN   TestAccAWSIAMInstanceProfile_importBasic
--- PASS: TestAccAWSIAMInstanceProfile_importBasic (12.75s)

@bflad bflad merged commit 4e8000d into hashicorp:master Jun 22, 2018
bflad added a commit that referenced this pull request Jun 22, 2018
@bflad
Copy link
Contributor

bflad commented Jun 27, 2018

This has been released in version 1.25.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Apr 5, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/iam Issues and PRs that pertain to the iam service. size/XS Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_iam_instance_profile doesn't export create_date
2 participants