-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
Version: 0.11.1
Attempted action: Manage an external access integration with password secret
Error:
titan.exceptions.MissingResourceException: Resource urn::xxx:secret/DUMMY_SECRET required by urn::xxx:external_access_integration/EAI_DUMMY not found or failed to fetch
Code to reproduce:
import os
import snowflake.connector
from titan.resources import ExternalAccessIntegration, NetworkRule, PasswordSecret, Schema, Database
from titan.blueprint import Blueprint, print_plan
connection_params = {
"account": os.environ["SNOWFLAKE_ACCOUNT"],
"user": os.environ["SNOWFLAKE_USER"],
"role": os.environ["SNOWFLAKE_ROLE"],
"database": os.environ["SNOWFLAKE_DATABASE"],
"warehouse": os.environ["SNOWFLAKE_WAREHOUSE"],
"authenticator": os.environ["SNOWFLAKE_AUTHENTICATOR"],
"private_key_file": os.environ["SNOWFLAKE_PRIVATE_KEY_PATH"],
"private_key_file_pwd": os.environ["PRIVATE_KEY_PASSPHRASE"],
}
resources = list()
database_config = {
"name": "DUMMY_DB"
}
resources.append(Database(**database_config))
schema_config = {
"name": "DUMMY_SCHEMA",
"database": "DUMMY_DB",
}
resources.append(Schema(**schema_config))
network_rule_config = {
"name": "DUMMY_NETWORK_RULE",
"database": "DUMMY_DB",
"schema": "DUMMY_SCHEMA",
"type": "IPV4",
"mode": "EGRESS",
"value_list": ["dummy.com:22"],
}
network_rule = NetworkRule(**network_rule_config)
resources.append(network_rule)
secret_config = {
"name": "DUMMY_SECRET",
"database": "DUMMY_DB",
"schema": "DUMMY_SCHEMA",
"username": "USER",
"password": "PW",
}
resources.append(PasswordSecret(**secret_config))
external_access_integration_config = {
"name": "EAI_DUMMY",
"database": "DUMMY_DB",
"schema": "DUMMY_SCHEMA",
"allowed_network_rules": [network_rule],
"allowed_authentication_secrets": ["DUMMY_SECRET"],
}
resources.append(ExternalAccessIntegration(**external_access_integration_config))
bp = Blueprint(run_mode="create-or-update", dry_run=True)
bp.add(resources)
session = snowflake.connector.connect(**connection_params)
plan = bp.plan(session)
print_plan(plan)Metadata
Metadata
Assignees
Labels
No labels