You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am in the process of adding a DBSubnetGroup resource to this plugin, I have somehow copied the code from EC2 Security Group resource and tried to adapt everything to make it work, so far I understood I need to:
Create a Nix config file, like ec2-rds-dbsubnet-group.nix with mkOption.
Add it to the default.nix using evalResources (which I am not sure to understand what it does exactly).
Create a Python logic file, like ec2_rds_dbsubnet_group.py which implements a Definition and a State and to ensure in the definition that resource type are matching.
Import it into the nixops.resources.__init__.py file.
Did I miss something? While my code is "working", it's not picking up the new resource declaration in one of my infrastructure.nix file.
EDIT: I add that I can see the resource inside my nixops info table, but I don't see it when I try to generate the plan of deployment. I don't know what exactly that means. Also, dependencies are set up so that VPCSubnet are all created before DBSubnet is created and DBInstance depends on DBSubnet, so I am supposed to see the correct order of dependencies and I'm unsure it is the case.
EDIT2: Finally made work a resource.
Basically, it seems like there are different practices to store referenced resources, some includes {name}.{type}.{resourceStateName ? key} when using the DiffEngine, or some override completely and use their own manual diff engine.
I think it'd be great to document how the diff engine works, what is its expectations, to improve its debuggability (I had to chase all the paths of code through many prints…) and maybe generalize it / improve it so that all use case can enter into them (I see some EC2 resources do not use a diff engine, I understand for the EC2 resource, but for others, I believe they can enter in the context of the diff engine).
Also, it'd be great to give some pointers on how to write and compose resources, I suppose it's cool to explain how we can references each resource by generating some identifier which enough data to rebuild the info during traversal.
Also, mixing manual XML stuff and diff engine seems to disable diff engine, I still don't really know why.
The text was updated successfully, but these errors were encountered:
I am in the process of adding a DBSubnetGroup resource to this plugin, I have somehow copied the code from EC2 Security Group resource and tried to adapt everything to make it work, so far I understood I need to:
ec2-rds-dbsubnet-group.nix
withmkOption
.default.nix
usingevalResources
(which I am not sure to understand what it does exactly).ec2_rds_dbsubnet_group.py
which implements a Definition and a State and to ensure in the definition that resource type are matching.nixops.resources.__init__.py
file.Did I miss something? While my code is "working", it's not picking up the new resource declaration in one of my
infrastructure.nix
file.EDIT: I add that I can see the resource inside my
nixops info
table, but I don't see it when I try to generate the plan of deployment. I don't know what exactly that means. Also, dependencies are set up so that VPCSubnet are all created before DBSubnet is created and DBInstance depends on DBSubnet, so I am supposed to see the correct order of dependencies and I'm unsure it is the case.EDIT2: Finally made work a resource.
Basically, it seems like there are different practices to store referenced resources, some includes
{name}.{type}.{resourceStateName ? key}
when using the DiffEngine, or some override completely and use their own manual diff engine.I think it'd be great to document how the diff engine works, what is its expectations, to improve its debuggability (I had to chase all the paths of code through many prints…) and maybe generalize it / improve it so that all use case can enter into them (I see some EC2 resources do not use a diff engine, I understand for the EC2 resource, but for others, I believe they can enter in the context of the diff engine).
Also, it'd be great to give some pointers on how to write and compose resources, I suppose it's cool to explain how we can references each resource by generating some identifier which enough data to rebuild the info during traversal.
Also, mixing manual XML stuff and diff engine seems to disable diff engine, I still don't really know why.
The text was updated successfully, but these errors were encountered: