creamy-nail-67991
09/23/2021, 1:46 PMComponentResource
receives an argument of using the InputList<T>
where T is a custom class which we manipulate before creating the cloud resources.
This means we have to iterate over the InputList
property and create resources within the Apply()
block. According to the documentation (https://www.pulumi.com/docs/intro/concepts/inputs-outputs)
“During some program executions, apply doesn’t run. For example, it won’t run during a preview, when resource output values may be unknown. Therefore, you should avoid side-effects within the callbacks. For this reason, you should not allocate new resources inside of your callbacks either, as it could lead to pulumi preview being wrong.”Is there a better way of doing this, without creating resources within the
Apply()
?
Here is a code snippet for some reference.
frontendEndpointArgs.Apply(endpoints =>
{
....
foreach (var frontend in endpoints)
{
if (frontend.HttpsConfiguration == null)
{
continue;
}
var httpsConfigurationArgs = new CustomHttpsConfigurationArgs
{
FrontendEndpointId = Output.Format($"/subscriptions/{currentSubscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontend.Name}"),
CustomHttpsProvisioningEnabled = true,
CustomHttpsConfigurationConfig = new CustomHttpsConfigurationCustomHttpsConfigurationArgs
{
CertificateSource = "AzureKeyVault",
AzureKeyVaultCertificateVaultId = frontend.HttpsConfiguration.Apply(fe => fe.AzureKeyVaultCertificateVaultId),
AzureKeyVaultCertificateSecretName = frontend.HttpsConfiguration.Apply(fe => fe.AzureKeyVaultCertificateSecretName),
AzureKeyVaultCertificateSecretVersion = frontend.HttpsConfiguration.Apply(fe => fe.AzureKeyVaultCertificateSecretVersion),
//MinimumTlsVersion = "1.2"
},
};
_ = frontend.Name.Apply(frontendName =>
new CustomHttpsConfiguration($"{frontendName}-SslCertificate", httpsConfigurationArgs, new CustomResourceOptions
{
Provider = provider,
Parent = parent,
}));
}
....
});
billions-mechanic-26704
09/23/2021, 2:42 PMBranchProtection
github resource https://www.pulumi.com/docs/reference/pkg/github/branchprotection/#branchprotection
And
BranchProtectionV3
github resource ?
https://www.pulumi.com/docs/reference/pkg/github/branchprotectionv3/#branchprotectionv3
I see there are some different resource properties inputs like in v3 there is branch
and in normal version i choose the branch using pattern
parameter
Which one should I choose?clean-toddler-25770
09/23/2021, 3:44 PMpurple-train-14007
09/23/2021, 5:27 PMrefined-tent-12187
09/23/2021, 5:58 PMbillions-mechanic-26704
09/23/2021, 8:53 PM__main__.py
azure-appservice.py
But it seems my code is only executed when it is in __main__.py
and the resources defined on azure-appservice.py
are not readed when I execute pulumi up
command.
Is there a way to use more than one python file similar to terraform?many-psychiatrist-74327
09/24/2021, 3:01 AMpulumi up
? The behavior I’m seeing:
I run pulumi up
. It takes an inordinate amount of time and hogs lots of resources. After ~10 mins, it fails with:
Diagnostics:
pulumi:pulumi:Stack (infra-dev):
error: an unhandled error occurred: Program exited with non-zero exit code: -1
If I run pulumi up
again, it runs quickly and with no errors.
This cycle happens every time I make a change. Is this a known bug or has anyone else seen this? It’s making development impossibly slow. Thanks!billions-mechanic-26704
09/24/2021, 2:59 PMdocker.Image
resource they use is not useful since build
parameter is required.
I am seeing this docker.RemoteImage
resource from docker pulumi api, but not sure how to indicate it that the image should be pulled from my container registry I got previously.
The code for getting my container registry is:
container_image = "wmlab"
# GETTING MY CONTAINER REGISTRY
rhdhv_container_registry = azure_native.containerregistry.Registry(
"rhdhvContainerRegistry",
admin_user_enabled=True,
location="westeurope",
network_rule_set=azure_native.containerregistry.NetworkRuleSetArgs(
default_action="Allow",
),
registry_name="rhdhvContainerRegistry",
resource_group_name="genericRG1",
sku=azure_native.containerregistry.SkuArgs(
name="Premium",
),
opts=pulumi.ResourceOptions(protect=True))
# OUTPUT THE CREDENTIALS TO GET THEM
acr_credentials = pulumi.Output.all("genericRG1", rhdhv_container_registry.name).apply(
lambda args: azure_native.containerregistry.list_registry_credentials(
resource_group_name=args[0],
registry_name=args[1]
)
)
admin_username = acr_credentials.username
admin_password = acr_credentials.passwords[0]["value"]
I am a bit confused about how to pull an image from the existing container registry I got.
Or perhaps does it need to be build and pushed from the same project? I would say should be possible to get an existing one. I need this because the build process is taking place in another repository projectbumpy-flag-23122
09/24/2021, 7:07 PMpulumi_kubernetes
package. We have a configmap object that works fine if the data is flat, but it fails to parse the indented usernameSecret
and passwordSecret
entries.
self.argo_configmap = ConfigMap(
resource_name='test_cm',
metadata=ObjectMetaArgs(name='argocd-cm',
namespace='argocd'),
data={
"type": "helm",
"url": "<https://test.com:8085>",
"name": "test-helm-repo",
"usernameSecret": {
"name": "test-helm-repo-credentials",
"key": "username"
},
"passwordSecret": {
"name": "test-helm-repo-credentials",
"key": "password"
}
},
I receive error:
AssertionError: Unexpected type; expected a value of type `<class 'str'>` but got a value of type `<class 'dict'>` at resource `test_cm`, property `data.passwordSecret`: {'name': 'test-helm-repo-credentials', 'key': 'password'}
bumpy-flag-23122
09/24/2021, 7:09 PMbumpy-flag-23122
09/24/2021, 7:19 PMself.argo_configmap = ConfigMap(
resource_name='test_cm',
metadata=ObjectMetaArgs(name='argocd-cm',
namespace='argocd'),
data={
"repositories": """- type: helm
url: <https://test.com:8085>
name: test-helm-repo
usernameSecret:
name: test-helm-repo-credentials
key: username
passwordSecret:
name: test-helm-repo-credentials
key: password
"""
},
great-table-28213
09/24/2021, 10:47 PMpulumi preview
on a github remote runner which is an ec2 instance with a role granting it permission.
How can I get Pulumi to assume the host's role to run vs passing it aws credentials?calm-quill-21760
09/24/2021, 11:57 PMpulumi_kubernetes.apiextensions.CustomResource
resource to wait upon successful completion of specific services in a pulumi_kubernetes.yaml.ConfigFile
. The CustomResource has ConfigFile listed in depends_on
, but watching the output of pulumi up
shows it’s still trying to run before ConfigFile has completed. What am I missing?alert-london-63088
09/25/2021, 5:50 AMno stack named 'myproject-dev*' found err?
. Pulumi up works just fine on my local machine, but not run through the action.
Here's a gist of my config;
https://gist.github.com/mhaagens/016c8139f2163a7b27fded86a5187a48
Can anyone help me out?flat-appointment-12338
09/25/2021, 2:06 PMup
, config
, refresh
, etc), the CLI somehow reverts to creating and selecting a stack by the same name in my personal account rather than in the organization. I have to pulumi stack select myorg/project/stack
after every commandgifted-dentist-89608
09/26/2021, 3:14 PMswift-island-2275
09/26/2021, 6:18 PMcalm-solstice-91146
09/27/2021, 10:54 AMdazzling-grass-65770
09/27/2021, 8:37 PMpurple-train-14007
09/27/2021, 8:59 PMpurple-train-14007
09/27/2021, 8:59 PMerror: constructing secrets manager of type "passphrase": unable to find either `PULUMI_CONFIG_PASSPHRASE` or `PULUMI_CONFIG_PASSPHRASE_FILE` when trying to access the Passphrase Secrets Provider; please ensure one of these environment variables is set to allow the operation to continue
future-window-78560
09/28/2021, 12:39 AMsparse-truck-33211
09/28/2021, 8:33 AMmicroscopic-finland-82315
09/28/2021, 8:34 AMcalm-solstice-91146
09/28/2021, 10:54 AMorange-vr-54756
09/28/2021, 12:04 PMdefault_account = gcp.service_account.Account("defaultAccount",
AttributeError: module 'pulumi_gcp' has no attribute 'service_account'
fresh-judge-73477
09/28/2021, 12:34 PMgo get <http://github.com/pulumi/pulumi-aws/sdk/v4/go/aws/wafv2|github.com/pulumi/pulumi-aws/sdk/v4/go/aws/wafv2>
on a k8 container environment. Everytime I get below error go build <http://github.com/pulumi/pulumi-aws/sdk/v4/go/aws/wafv2|github.com/pulumi/pulumi-aws/sdk/v4/go/aws/wafv2>: /usr/local/go/pkg/tool/linux_amd64/compile: signal: killed
. Below is the memort snapshot when it crashed total used free shared buff/cache available
Mem: 15Gi 14Gi 218Mi 1.0Mi 238Mi 174Mi
Swap: 0B 0B 0B
#golang #awspurple-train-14007
09/28/2021, 4:14 PMpurple-train-14007
09/28/2021, 4:17 PMpolite-mechanic-60124
09/28/2021, 6:41 PMoutput<string>
on pulumi preview on a clean environment or is an Output<Mapping> on an incrementally updated environment.
job_vars = pulumi.Output.all(
_redis_endpoint=cache.endpoint, # should be an Output string
**job_specific_inputs, # dict
**generic_job_inputs, # dict
)
pulumi.export("core", job_vars)
pulumi preview on clean environment: core : output<string>
pulumi up on incrementally updated environment:
+ core : {
+ analyzer_bucket : "analyzers-bucket-196f898"
+ analyzer_dispatched_bucket : "dispatched-analyzer-bucket-5177198"
Is there any recommended way to force output to be a mapping type?