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

Update S3 Cors-Rule Subresource to Improve Diff Output #566

Open
mlivas opened this issue May 27, 2022 · 0 comments
Open

Update S3 Cors-Rule Subresource to Improve Diff Output #566

mlivas opened this issue May 27, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@mlivas
Copy link
Contributor

mlivas commented May 27, 2022

When updating the allowed-origins list in an existing cors-rule for an s3-bucket, the output from Gyro appears to be entirely deleting the existing cors-rule and creating a new cors-rule with the new allowed-origins list. I expected Gyro to output that only the allowed-origins list was changing. The deletion and creation output makes it more difficult to determine if only my desired update is happening.

Based on the Gyro output, the cors rule appears to be named/idenfitied under the hood by its entire set of configurations, which likely prevents gyro from seeing that only one aspect of the configuration is changing.

Example config change:

 aws::s3-bucket "assets"
     name: "example-assets"

     cors-rule
         max-age-seconds: 3000
         allowed-headers: ["*"]
         allowed-methods: ["GET"]
         allowed-origins: [
             "https://example.com",
             "https://*.example.com",
+            "https://example2.com",
+            "https://*.example2.com"
         ]
     end
 end

Current Gyro Up output:

⟳ Update aws::s3-bucket assets (example-assets)
  · cors-rule:  -[cors-rule s3 cors rule - allowed-origins [https://example.com,https://*.example.com], allowed-methods [GET], allowed-headers [*], expose-headers [], max-age-seconds [3000]] → +[cors-rule s3 cors rule - allowed-origins [https://example.com,https://*.example.com,https://example2.com,https://*.example2.com], allowed-methods [GET], allowed-headers [*], expose-headers [], max-age-seconds [3000]]
    + Create cors-rule s3 cors rule - allowed-origins [https://example.com,https://*.example.com,https://example2.com,https://*.example2.com], allowed-methods [GET], allowed-headers [*], expose-headers [], max-age-seconds [3000]
      · allowed-headers: [ '*' ]
      · allowed-methods: [ 'GET' ]
      · allowed-origins: [ 'https://example.com', 'https://*.example.com', 'https://example2.com', 'https://*.example2.com' ]
      · max-age-seconds: 3000
    - Delete cors-rule s3 cors rule - allowed-origins [https://example.com,https://*.example.com], allowed-methods [GET], allowed-headers [*], expose-headers [], max-age-seconds [3000]

Expected Gyro Up output:

⟳ Update aws::s3-bucket assets (example-assets)
    ⟳ Update cors-rule s3 cors rule
      · allowed-headers: [ '*' ]
      · allowed-methods: [ 'GET' ]
      · allowed-origins: -[ 'https://example.com', 'https://*.example.com' ] → +[ 'https://example.com', 'https://*.example.com', 'https://example2.com', 'https://*.example2.com' ]
      · max-age-seconds: 3000
@deepanjan90 deepanjan90 added the bug Something isn't working label May 27, 2022
@deepanjan90 deepanjan90 modified the milestones: 1.4.6, 1.5.0 May 27, 2022
@deepanjan90 deepanjan90 removed this from the 1.5.0 milestone Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants