https://pulumi.com logo
#general
Title
# general
q

quick-wolf-8403

12/31/2021, 5:34 PM
Hi folks! I'm using the Fastly CDN tool to create a GCS-backed service. Everything works great, aside from one piece: adding a VCL Snippet. (Fastly recommends this in their by-hand instructions.) I want to create a new https://www.pulumi.com/registry/packages/fastly/api-docs/servicedynamicsnippetcontentv1/#inputs --but it looks like I need a snippet ID of an existing snippet to create a new one. Chicken/Egg? Do you folks have some ideas?
Copy code
fixCachingVCL, err := fastly.NewServiceDynamicSnippetContentv1(ctx, "X-Http-Method-Override",
	&fastly.ServiceDynamicSnippetContentv1Args{
		Content:   pulumi.String("unset req.http.X-Http-Method-Override;"),
		ServiceId: bitmovincdn.ID(),
		SnippetId: , // Need a real one. manual?
	})
I realized that I had not created the Dynamicsnippets section of my original Servicev1. Now I'm struggling trying to get the particular SnippetId out of the OuputArray.
Ah, that's where "lifting" comes into it! This works:
Copy code
SnippetId: bitmovincdn.Dynamicsnippets.Index(<http://pulumi.Int|pulumi.Int>(0)).SnippetId().Elem(),
5 Views