strong-helmet-83704
09/06/2022, 5:17 PMtry:
vgw = aws.ec2.get_vpn_gateway(
filters=[aws.ec2.GetVpnGatewayFilterArgs(
name="tag:Name",
values=[f"Vgw"],
)], opts=pulumi.ResourceOptions(provider=provider_options)
)
vgw = aws.ec2.VpnGateway(f"Vgw",
tags={"Name": f"Vgw"},
opts=pulumi.ResourceOptions(
provider=provider_options,
retain_on_delete=True,
import_=vgw.id
)
)
except:
vgw = aws.ec2.VpnGateway(f"Vgw",
tags={"Name": f"Vgw"},
opts=pulumi.ResourceOptions(
provider=provider_options,
retain_on_delete=True
)
)
Is this is the best way to achieve this? It works but it doesn't seem particularly elegant for such a common / simple task.millions-furniture-75402
09/06/2022, 5:29 PMstrong-helmet-83704
09/06/2022, 5:33 PMvictorious-church-57397
09/06/2022, 5:50 PMgetRepository(jugoRepo).then((impRepo) => {
// Import the repository
const importedRepository = new github.Repository(
`${jugoRepo.name}-repository`,
{
...(impRepo as unknown as RepositoryArgs),
defaultBranch: undefined,
private: undefined,
pages: undefined,
deleteBranchOnMerge: true,
},
{
protect: true,
import: jugoRepo.name,
ignoreChanges: ["vulnerabilityAlerts", "isTemplate"],
}
);
it can be a bit of a nightmare importing if the inputs/outputs dont match uplittle-cartoon-10569
09/06/2022, 9:10 PMgreat-sunset-355
09/07/2022, 8:03 AMmillions-furniture-75402
09/07/2022, 2:27 PMlittle-cartoon-10569
09/07/2022, 8:34 PMstrong-helmet-83704
09/08/2022, 12:05 AM