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

fix: project_api_key data source missing project_assignment attribute #1356

Merged
merged 4 commits into from
Aug 2, 2023

Conversation

andreaangiolillo
Copy link
Collaborator

@andreaangiolillo andreaangiolillo commented Jul 31, 2023

Description

Ticket: INTMDB-969

This PR adds the project_assignment to the data source project_api_key has we forgot to add it

Type of change:

  • Bug fix (non-breaking change which fixes an issue). Please, add the "bug" label to the PR.
  • New feature (non-breaking change which adds functionality). Please, add the "enhancement" label to the PR.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected). Please, add the "breaking change" label to the PR.
  • This change requires a documentation update
  • Documentation fix/enhancement

Required Checklist:

  • I have signed the MongoDB CLA
  • I have read the contribution guidelines
  • I have added tests that prove my fix is effective or that my feature works per HashiCorp requirements
  • I have added any necessary documentation (if appropriate)
  • I have run make fmt and formatted my code

Further comments

Tested locally + Added acceptance tests

terraform state show data.mongodbatlas_project_api_key.test
# data.mongodbatlas_project_api_key.test:
data "mongodbatlas_project_api_key" "test" {
    api_key_id         = "64c7eb2c175e1e5d357fb05c"
    description        = "TF key"
    id                 = "terraform-20230731171109811200000001"
    private_key        = "********-****-****-56f6fb43a7b3"
    project_assignment = [
        {
            project_id = "63f4d4a47baeac59406dc131"
            role_names = [
                "GROUP_OWNER",
                "GROUP_READ_ONLY",
            ]
        },
        {
            project_id = "64b8d3219c4cdc3f9108e318"
            role_names = [
                "GROUP_READ_ONLY",
            ]
        },
    ]
    project_id         = "63f4d4a47baeac59406dc131"
    public_key         = "estakgih"
    role_names         = [
        "GROUP_OWNER",
        "GROUP_READ_ONLY",
    ]
}
terraform state show data.mongodbatlas_project_api_keys.test
# data.mongodbatlas_project_api_keys.test:
data "mongodbatlas_project_api_keys" "test" {
    id         = "terraform-20230731171830248700000001"
    project_id = "63f4d4a47baeac59406dc131"
    results    = [
        {
            api_key_id         = "64c7eb2c175e1e5d357fb05c"
            description        = "TF key"
            private_key        = "********-****-****-56f6fb43a7b3"
            project_assignment = [
                {
                    project_id = "63f4d4a47baeac59406dc131"
                    role_names = [
                        "GROUP_OWNER",
                        "GROUP_READ_ONLY",
                    ]
                },
                {
                    project_id = "64b8d3219c4cdc3f9108e318"
                    role_names = [
                        "GROUP_READ_ONLY",
                    ]
                },
            ]
            public_key         = "estakgih"
            role_names         = [
                "GROUP_OWNER",
                "GROUP_READ_ONLY",
            ]
        },
    ]
}

@andreaangiolillo andreaangiolillo marked this pull request as ready for review July 31, 2023 17:20
@andreaangiolillo andreaangiolillo requested a review from a team as a code owner July 31, 2023 17:20
Copy link
Contributor

@Zuhairahmed Zuhairahmed left a comment

Choose a reason for hiding this comment

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

LGTM

@andreaangiolillo andreaangiolillo merged commit 6aa966b into master Aug 2, 2023
@andreaangiolillo andreaangiolillo deleted the INTMDB-969 branch August 2, 2023 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants