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

Improve UX For List Block Types with Max 1 Element #258

Closed
skorfmann opened this issue Jul 28, 2020 · 1 comment · Fixed by #935
Closed

Improve UX For List Block Types with Max 1 Element #258

skorfmann opened this issue Jul 28, 2020 · 1 comment · Fixed by #935
Labels
enhancement New feature or request

Comments

@skorfmann
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

There are more then 3000 occasions in the AWS schema where a list type can have at most one element or exactly one element. See this example of t he AwsProvider schema and note the max_items at the bottom:

      "assume_role": {
        "nesting_mode": "list",
        "block": {
          "attributes": {
            "external_id": {
              "type": "string",
              "description": "The external ID to use when assuming the role. If omitted, no external ID is passed to the AssumeRole call.",
              "optional": true
            },
            "policy": {
              "type": "string",
              "description": "The permissions applied when assuming a role. You cannot use, this policy to grant further permissions that are in excess to those of the,  role that is being assumed.",
              "optional": true
            },
            "role_arn": {
              "type": "string",
              "description": "The ARN of an IAM role to assume prior to making API calls.",
              "optional": true
            },
            "session_name": {
              "type": "string",
              "description": "The session name to use when assuming the role. If omitted, no session name is passed to the AssumeRole call.",
              "optional": true
            }
          }
        },
        "max_items": 1
      },

I'm wondering if it makes sense, to not render these schema types as Lists, but as objects.

Rather than:

    new AwsProvider(this, 'aws', {
      region: 'eu-central-1',
      assumeRole: [{
        roleArn: 'abc',
        sessionName: 'foo',
        externalId: 'bar'
      }]
    })

I'd expect this, which also aligns with the Terraform docs

    new AwsProvider(this, 'aws', {
      region: 'eu-central-1',
      assumeRole: {
        roleArn: 'abc',
        sessionName: 'foo',
        externalId: 'bar'
      }
    })

References

#253

@skorfmann skorfmann added the enhancement New feature or request label Jul 28, 2020
DanielMSchmidt added a commit that referenced this issue Aug 26, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Aug 26, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Aug 26, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Aug 27, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Aug 27, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Aug 27, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Aug 27, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Aug 27, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Aug 30, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Sep 7, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Sep 7, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Sep 7, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Sep 8, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Sep 8, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Sep 8, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Sep 8, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Sep 8, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Sep 13, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Sep 21, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Sep 23, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Sep 28, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 4, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 5, 2021
BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 11, 2021
BREAKING CHANGE: This changes the API surface of every provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 11, 2021
BREAKING CHANGE: This changes the API surface of every provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 12, 2021
BREAKING CHANGE: This changes the API surface of every provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 12, 2021
BREAKING CHANGE: This changes the API surface of every provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 12, 2021
BREAKING CHANGE: This changes the API surface of every provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 12, 2021
This improves the UI surface so that less arrays are being used and direct access of properties is way easier

BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 12, 2021
This improves the UI surface so that less arrays are being used and direct access of properties is way easier

BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 13, 2021
This improves the UI surface so that less arrays are being used and direct access of properties is way easier

BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 13, 2021
This improves the UI surface so that less arrays are being used and direct access of properties is way easier

BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 14, 2021
This improves the UI surface so that less arrays are being used and direct access of properties is way easier

BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 14, 2021
This improves the UI surface so that less arrays are being used and direct access of properties is way easier

BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 18, 2021
This improves the UI surface so that less arrays are being used and direct access of properties is way easier

BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 18, 2021
This improves the UI surface so that less arrays are being used and direct access of properties is way easier

BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 18, 2021
This improves the UI surface so that less arrays are being used and direct access of properties is way easier

BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 19, 2021
This improves the UI surface so that less arrays are being used and direct access of properties is way easier

BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 19, 2021
This improves the UI surface so that less arrays are being used and direct access of properties is way easier

BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
DanielMSchmidt added a commit that referenced this issue Oct 19, 2021
This improves the UI surface so that less arrays are being used and direct access of properties is way easier

BREAKING CHANGE: This changes the API surface of every module / provider

Closes #258
@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2022

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've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant