sparse-intern-71089
03/11/2021, 4:52 PMwitty-candle-66007
03/11/2021, 8:05 PMthousands-arm-78308
03/11/2021, 10:50 PMimport * as path from 'path';
import { promises as fs} from 'fs';
import { apigateway } from '@pulumi/gcp';
const specificationRequest = fs.readFile(path.join(__dirname, 'src', 'stack', 'specification.yaml'))
.then(content => content.toString('base64'))
const api = new apigateway.Api('sweet-autumn-api', {
displayName: 'Sweet Autumn API',
apiId: 'sweet-autumn-api',
});
const apiConfig = new apigateway.ApiConfig('discord-webhook-config', {
displayName: 'Discord Webhook API Config',
api: api.id,
openapiDocuments: [{
document: {
contents: specificationRequest,
path: 'test.yaml'
}
}]
});
const gateway = new apigateway.Gateway('discord-webhook-gateway', {
displayName: 'Discord Webhook Gateway',
gatewayId: 'discord-webhook-gateway',
apiConfig: apiConfig.id,
region: 'europe-west1'
});
export const apiId = api.id;
export const apiConfigId = apiConfig.id;
export const gatewayId = gateway.id;
witty-candle-66007
03/12/2021, 1:44 PMspecification.yaml
file?witty-candle-66007
03/12/2021, 1:47 PMthousands-arm-78308
03/12/2021, 2:19 PMthousands-arm-78308
03/12/2021, 2:20 PMerror: 1 error occurred:
* Error creating ApiConfig: googleapi: got HTTP response code 404 with body: <!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-re
peat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/go
oglelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.g
<http://oogle.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png|oogle.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png>) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 1
00%}}#logo{display:inline-block;height:54px;width:150px}
</style>
<a href=//www.google.com/><span id=logo aria-label=Google></span></a>
<p><b>404.</b> <ins>That's an error.</ins>
<p>The requested URL <code>/v1beta/projects/sweet-autumn/locations/global/apis/projects/sweet-autumn/locations/global/apis/sweet-autumn-api/configs?alt=json&apiConfigId=terraform-20210312141801092200000001</code> was not found on this server. <ins>That's all w
e know.</ins>
witty-candle-66007
03/12/2021, 4:42 PMapi: api.apiId
and not api: api.id
The id
property is the whole “path” for the Api, but the ApiConfig only wants the “name” of the API which is actually apiId
If you export your entire api
you’ll see the properties and it’ll make a bit more sense what I’m saying.thousands-arm-78308
03/13/2021, 12:53 AMerror: 1 error occurred:
* Error creating ApiConfig: googleapi: Error 400: Service account "projects/-/serviceAccounts/29777571002-compute@developer.gserviceaccount.com" not found. Try specifying a service account that exists in this project.
In the console when creating an api config it requires you to specify a service account but I find so much options in the args for the ApiConfig in pulumi, perhaps related?witty-candle-66007
03/13/2021, 1:56 PMthousands-arm-78308
03/13/2021, 3:21 PM