feat(cdn) - Feature parity - #1601
Conversation
|
Hi @matheuspolitano, |
|
This PR was marked as stale after 7 days of inactivity and will be closed after another 7 days of further inactivity. If this PR should be kept open, just add a comment, remove the stale label or push new commits to it. |
| "backend": backend, | ||
| "regions": regionsFixture, | ||
| "blocked_countries": blockedCountriesFixture, | ||
| "blocked_ips": types.ListValueMust(types.StringType, []attr.Value{}), |
There was a problem hiding this comment.
Could you add some tests where the values are not null
| cdnSdk "github.com/stackitcloud/stackit-sdk-go/services/cdn/v1api" | ||
| ) | ||
|
|
||
| func createTestConfig(vals map[string]attr.Value) types.Object { |
There was a problem hiding this comment.
Please add tests here as well to test the values. The createTestConfig is kind of special. Maybe you could use a fixture config like in other tests instead of this?
| Computed: true, // Required when using Default | ||
| Description: schemaDescriptions["config_blocked_ips"], | ||
| ElementType: types.StringType, | ||
| Default: listdefault.StaticValue(types.ListValueMust(types.StringType, []attr.Value{})), |
There was a problem hiding this comment.
We try to avoid using defaults because then the value gets actively set by Terraform, and you cannot use a server-side default or change this later. Feel free to reach out to me if you have further questions regarding this.
| }, | ||
| "default_cache_duration": schema.StringAttribute{ | ||
| Optional: true, | ||
| Computed: true, |
There was a problem hiding this comment.
Is this value changed by the service?
| }, | ||
| "monthly_limit_bytes": schema.Int64Attribute{ | ||
| Optional: true, | ||
| Computed: true, |
There was a problem hiding this comment.
Is this value changed by the service?
| if !utils.IsUndefined(configModel.StripResponseCookies) { | ||
| configPatch.StripResponseCookies = configModel.StripResponseCookies.ValueBoolPointer() | ||
| } | ||
| if !utils.IsUndefined(configModel.DefaultCacheDuration) { |
There was a problem hiding this comment.
Interesting that there is a toCreatePayload but no toUpdatePayload function 🤔 If you like, you could introduce that, but it's not a must-have because it was already that way. But would be much cleaner and better testable.
Description
(https://jira.schwarz/browse/STACKITCDN-1451)
Checklist
make fmtexamples/directory)make generate-docs(will be checked by CI)make test(will be checked by CI)make lint(will be checked by CI)