VSChina / magic-modules

Magic Modules: Automagically generate Google Cloud Platform support for OSS
Apache License 2.0
1 stars 4 forks source link

MM uses unexpected check type for output field #25

Closed neil-yechenwei closed 5 years ago

neil-yechenwei commented 5 years ago

Basic.yml: properties: virtual_wan: id:"${azurerm_virtual_wan.<%=resource_id_hint-%>.id}"

.go file: resource.TestCheckResourceAttr(dataSourceName, "virtual_wan.0.id", "${azurerm_virtual_wan.<%= resource_id_hint -%>.id}"),

houkms commented 5 years ago

This issue was solved in PR #40.

houkms commented 5 years ago

We provide the features of

The customization rules in the basic.yaml or complete.yaml are

Here is an example. And this results in checking only all the representations with prefix custom_rules.1 in test file.

--- !ruby/object:Provider::Azure::Example
resource: azurerm_web_application_firewall_policy
prerequisites:
  - !ruby/object:Provider::Azure::ExampleReference
    product: resourcegroup
    example: basic
properties:
  name: "<%= get_resource_name('ApplicationGatewayWebApplicationFirewallPolicies', 'wafpolicy') -%>"
  resource_group_name: ${azurerm_resource_group.<%= resource_id_hint -%>.name}
  location: ${azurerm_resource_group.<%= resource_id_hint -%>.location}
  custom_rules:
    - name: Rule1
      priority: 1
      rule_type: MatchRule
      match_conditions:
        - match_variables:
            - variable_name: RemoteAddr
          operator: IPMatch
          negation_conditon: false
          match_values: [192.168.1.0/24, 10.0.0.0/24]
      action: Block
    - name: Rule2
      priority: 2
      rule_type: MatchRule
      match_conditions:
        - match_variables:
            - variable_name: RemoteAddr
          operator: IPMatch
          negation_conditon: false
          match_values: [192.168.1.0/24]
        - match_variables:
            - variable_name: RequestHeaders
              selector: UserAgent
          operator: Contains
          negation_conditon: false
          match_values: [Windows]
      action: Block
property_check_excludes:
  - custom_rules.#
  - custom_rules.0.*