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

helper/schema: Do not collapse TypeSet hash values when configuration block contains only Computed attributes #22719

Closed
wants to merge 1 commit into from

Commits on Sep 6, 2019

  1. helper/schema: Do not collapse TypeSet hash values when configuration…

    … block contains only Computed attributes
    
    Reference: hashicorp/terraform-provider-aws#7198
    
    When a resource schema contains the following:
    
    ```go
    "config_block_attribute": {
    	Type:     schema.TypeSet,
    	Computed: true,
    	Elem: &schema.Resource{
    		Schema: map[string]*schema.Schema{
    			"attribute1": {
    				Type:     schema.TypeBool,
    				Computed: true,
    			},
    			"attribute2": {
    				Type:     schema.TypeString,
    				Computed: true,
    			},
    		},
    	},
    },
    ```
    
    The TypeSet hash values were previously all collapsed to the zero-value, which meant that multiple set entries were lost. Here we check that all of the attributes are not just `Computed: true`. If they are all `Computed: true` attributes, ignore the check for user-defined attributes to compute the hash value.
    bflad committed Sep 6, 2019
    Configuration menu
    Copy the full SHA
    db88597 View commit details
    Browse the repository at this point in the history