Closed shaidar closed 2 years ago
Tested out new version of pulumi-fastly
provider (4.0.1) and ran into the same issue. Ran pulumi up with the minimal example below. It created the Fastly distro successfully, however after tweaking the code by changing the domain comment, it threw the infamous ServiceVersion error
# Original minimal example
import pulumi
import pulumi_fastly as fastly
ol_devops_qa = fastly.ServiceVcl("ol-devops-qa",
backends=[fastly.ServiceVclBackendArgs(
address="127.0.0.1",
name="localhost",
port=80,
)],
domains=[fastly.ServiceVclDomainArgs(
comment="ol-devops-qa",
name="ol-devops-qa.odl.mit.edu",
)],
force_destroy=True)
# Tweaked minimal example by changing comment
import pulumi
import pulumi_fastly as fastly
ol_devops_qa = fastly.ServiceVcl("ol-devops-qa",
backends=[fastly.ServiceVclBackendArgs(
address="127.0.0.1",
name="localhost",
port=80,
)],
domains=[fastly.ServiceVclDomainArgs(
comment="ol-devops-test",
name="ol-devops-qa.odl.mit.edu",
)],
force_destroy=True)
This is still blocked until https://github.com/pulumi/pulumi-fastly/issues/119 is resolved
Issue has been resolved and am currently importing the existing OCW Fastly distro configs into Pulumi. Had to import both ServiceVcl
and ServiceDictionaryItems
to cover all the configured resources. Now pulumi state has the following fastly configs imported:
Will not work on templatising the output so that we have the Fastly configs as Pulumi code and going forward we can ensure that changes go through the normal code change process to avoid config drift.
In an effort to standardize the OCW Fastly configs, we had started working on using the
pulumi-fastly
provider whereby we manually create a Fastly template distribution containing all the necessary OCW configs, importing that into Pulumi and then using the Pulumi code generated to configure the already existing Fastly OCW distributions.The template distro config:
Things I tried:
Using pulumi-fastly
4.0.0
, tried importing an existing distro (ol-devops-ci
), added logging or made a minor change and then running pulumi up, and it failed with the following error:missing required field 'ServiceVersion'
This appears to be a known issue with the latest version.Tried downgrading to different pulumi-fastly provider versions (3.7.0, 3.11.0, 3.12.0) which uses the
fastly.Servicev1
as opposed tofastly.ServiceVcl
being now used in version 4.0.0 however the not so descriptive error I was encountering was:error: unknown resource type '<nil>'
Using pulumi-fastly
4.0.0
, I was able to create a new distro (based on the config above) and that was successful. However, when I tried tweaking anything in that config and running pulumi up again, I encountered theServiceVersion
error and when I ran it again, it was successful, however when checking on the Fastly config, it was still running the old version and the change wasn't deployed.Additionally when doing all this testing, there were a few times when pulumi up succeeded however when I checked on the Fastly distro, it was still on the old version and no changes had been deployed. In that sense it was quite misleading and not reliable to be used in a prod environment.
Solution