-
Notifications
You must be signed in to change notification settings - Fork 8
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
Multipart/form-data with File upload does not work with Pulumi #611
Comments
One more info: in terraform this seems to work ( according to datadog support ) |
Thanks for the report here @frank-bee and sorry for the trouble. Can you please provider a pulumi program which reproduces this? Given that you've also tested in Terraform, can you please provide the terraform program too? To verify, did you also import the resource in terraform and then run apply with the generated code or did you import the state without generating code? |
@VenelinMartinov Otherwise I can try to repoduce it again or at least send you some sample code. |
Hi @VenelinMartinov again, here some sample code, but I didn't run it after reducing it to the critical part.
|
Thanks for providing the details @frank-bee. I've been unable to run that code as it seems to depend on other external bits, however I managed to reproduce the issue with the following: import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
const testApi = new datadog.SyntheticsTest("test_api", {
name: "An API test on example.org",
type: "api",
subtype: "http",
status: "live",
message: "Notify @pagerduty",
locations: ["aws:eu-central-1"],
tags: [
"foo:bar",
"foo",
"env:test",
],
requestDefinition: {
bodyType: "multipart/form-data", // added after first pulumi up
method: "GET",
url: "https://www.example.org",
},
requestHeaders: {
"Content-Type": "application/json",
Authentication: "Token: 1234566789",
},
assertions: [{
type: "statusCode",
operator: "is",
target: "200",
}],
optionsList: {
tickEvery: 900,
retry: {
count: 2,
interval: 300,
},
monitorOptions: {
renotifyInterval: 120,
},
},
},{
import: "ate-p9x-735" // added after first pulumi up
}); |
However running the
This generates code for the test which works with some slight modifications. Does that work around the issue for you? If not, can you please explain what you are trying to achieve here? Why are you modifying the test in the dashboard? Can you use the pulumi program to achieve the same? |
Hi @VenelinMartinov , did you try a file Upload in the body of the multipart form data and afterwards import? yaml file ideally ,this is what we use |
I tried to create a test with your code above getting
But there is no resource created , so how should I import something? |
Hey @frank-bee, the code above was for confirming that the issue is indeed present. It should provide the same error message. For working around the issue can you try:
const testApi = new datadog.SyntheticsTest("test_api", {
name: "An API test on example.org",
type: "api",
subtype: "http",
status: "live",
message: "Notify @pagerduty",
locations: ["aws:eu-central-1"],
tags: [
"foo:bar",
"foo",
"env:test",
],
requestDefinition: {
method: "GET",
url: "https://www.example.org",
},
requestHeaders: {
"Content-Type": "application/json",
Authentication: "Token: 1234566789",
},
assertions: [{
type: "statusCode",
operator: "is",
target: "200",
}],
optionsList: {
tickEvery: 900,
retry: {
count: 2,
interval: 300,
},
monitorOptions: {
renotifyInterval: 120,
},
},
}
|
Describe what happened
How to reproduce
--> see error below
Sample program
Log output
Error:
Affected Resource(s)
No response
Output of
pulumi about
Additional context
Datadog support wrote
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: