bitter-army-70832
04/11/2022, 12:45 AMbored-monitor-99026
04/11/2022, 2:22 AMtype Team struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Slug string `yaml:"slug"`
ParentTeamId int
Teams []Team `yaml:"teams"`
}
here is what i have:
@dataclass
class Team:
name: str
slug: str
description: str
...
subteams: Optional[list[Team]]
parent_team_id: Optional[int] = None
the team data is read from a yaml file
here are several issues:
1. in order to use .
refence , you have to do Team(**team)
to create the object, where team
is a python dict read from YAML. however, this will be flagged by type checker: Arguments missing for parameters "name", "slug", "description
2. there is a nested field subteams
, when reading from yaml, it's not automatically deserialized, so you have to create the object again Team(**sub_team)
to use .
reference
3. since not every team entry has subteam
field, you have to assign empty list as default value. but when you iterate over the entries in yaml, you will have type error Object of type "None" cannot be used as iterable value
when you do parent_team.subteams
stocky-butcher-62635
04/11/2022, 9:49 AMstocky-butcher-62635
04/11/2022, 10:02 AMerror: Running program 'C:\Work\Azure\RwbPulumiProject\bin\Debug\netcoreapp3.1\RwbPulumiProject.dll' failed with an unhandled exception:
System.ArgumentNullException: [Input] Pulumi.AzureNative.AzureData.SqlServerArgs.SqlServerRegistrationName is required but was not given a value (Parameter 'SqlServerRegistrationName')
stocky-butcher-62635
04/11/2022, 10:05 AMSQL server
things in Azure's lit of All resource but no 'SQL server registration'. Why is pulumi requiring this?stocky-butcher-62635
04/11/2022, 10:06 AMstocky-butcher-62635
04/11/2022, 11:13 AMPulumi.AzureNative.AzureData.SqlServer
is not Pulumi.AzureNative.Sql.Server
stocky-butcher-62635
04/11/2022, 11:18 AMstocky-butcher-62635
04/11/2022, 11:26 AMpulumi state delete
?stocky-butcher-62635
04/11/2022, 11:26 AMup
is quite hard work!stocky-butcher-62635
04/11/2022, 11:34 AMSql.Server sqlServer = new Sql.Server($"{PulumiProject}-{ae}-sql-server", new Sql.ServerArgs()
{
ResourceGroupName = resourceGroup.Name,
AdministratorLogin = "rwb",
AdministratorLoginPassword = "Rwb196884-AaBbCcDd12234&*()"
});
but
azure-native:sql:Server (RwbPulumiProject-rwb-dev-sql-server):
error: resource partially created but read failed autorest/azure: Service returned an error. Status=404 Code="ResourceNotFound" Message="The requested resource of type 'Microsoft.Sql/servers' with name 'RwbPulumiProject-rwb-dev-sql-server17e42d66' was not found.": Code="PasswordNotComplex" Message="Password validation failed. The password does not meet policy requirements because it is not complex enough."
stocky-butcher-62635
04/11/2022, 11:54 AMstocky-butcher-62635
04/11/2022, 11:55 AMstocky-butcher-62635
04/11/2022, 11:55 AMstocky-butcher-62635
04/11/2022, 12:15 PMSystem.Diagnostics.Debug.WriteLine
doesn't work. How do you debug the programme?stocky-butcher-62635
04/11/2022, 12:22 PMconfig.Require(...)
returns Output<string>
and there is no way to get the actual value?stocky-butcher-62635
04/11/2022, 12:46 PMpulumi stack change-secrets-provider
is for where the encryption key is stored but not for the encrypted values themselves.
How do I change it back? Looks like I have to delete the stack and start over?stocky-butcher-62635
04/11/2022, 12:47 PMbrainy-church-78120
04/11/2022, 2:18 PMstocky-butcher-62635
04/11/2022, 4:06 PMechoing-smartphone-60420
04/11/2022, 7:01 PMhelm hook
issues? đź§µstocky-butcher-62635
04/12/2022, 12:33 PM// Make the database conneciotn string and store it in the key vault.
Output<string> cs = administratorLoginPassword.Apply(z => $"Server={sqlServer.FullyQualifiedDomainName}; Database={database.Name}, uid=rwb, pwd={z}");
KeyVault.Secret s = new KeyVault.Secret($"{PulumiProject}-{ae}-key-vault-secret", new KeyVault.SecretArgs()
{
ResourceGroupName = resourceGroup.Name,
VaultName = v.Name,
SecretName = "ConnectionString",
Properties = new KeyVault.Inputs.SecretPropertiesArgs() { Value = cs }
});
But the value is coming out as junk
Server=Calling [ToString] on an [Output<T>] is not supported.
To get the value of an Output<T> as an Output<string> consider:
1. o.Apply(v => $"prefix{v}suffix")
2. Output.Format($"prefix{hostname}suffix");
See <https://pulumi.io/help/outputs> for more details.
This function may throw in a future version of Pulumi.; Database=Calling [ToString] on an [Output<T>] is not supported.
To get the value of an Output<T> as an Output<string> consider:
1. o.Apply(v => $"prefix{v}suffix")
2. Output.Format($"prefix{hostname}suffix");
See <https://pulumi.io/help/outputs> for more details.
This function may throw in a future version of Pulumi., uid=rwb, pwd=Sql-Server-Admin-Password
stocky-butcher-62635
04/12/2022, 12:35 PMyml
config or to generate it on the fly so that I have a proper string instead of this Output
that can't be usedstocky-butcher-62635
04/12/2022, 12:35 PMechoing-smartphone-60420
04/12/2022, 1:10 PM.release
apiquick-airport-30353
04/12/2022, 3:34 PMincalculable-thailand-44404
04/12/2022, 5:56 PMconst repository = new aws.ecr.Repository(".......");
const serviceImage = pulumi.output(aws.ecr.getImage({
imageTag: "latest",
repositoryName: ... NEED TO SPECIFY THE ACTUAL STRING REPO NAME...,
}));
repository.name
is of the form : pulumi.Output<String>
which is why I cannot use it as is.white-chef-55657
04/13/2022, 11:57 AMindex.ts
but it’s not being recognized as an output - is pulumi picking up all of the exports from all the files or do I need to indicate something specific in the root level index.ts
?rhythmic-branch-12845
04/14/2022, 9:06 AMfull-king-49894
04/14/2022, 8:55 PM