-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added dynamic cred support during compile (#193)
(cherry picked from commit 9bf45c9b02f2e53c0fe3f0792f48b043adc197ee)
- Loading branch information
1 parent
3e21b5c
commit 20a6de1
Showing
3 changed files
with
50 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% macro var_dict_obj(var_list) %} | ||
{ | ||
{% for var in var_list %} | ||
'{{var.name}}': {% if var.type == "SECRET" %} {{var.value}} {% else %} '{{var.value}}' {% endif %}, | ||
{% endfor %} | ||
} | ||
{% endmacro %} | ||
|
||
{% macro cred(obj) %} | ||
{% if obj.default %} | ||
{{obj.var_name}} = dynamic_cred('{{obj.username}}', Ref.Account('{{obj.account}}'), {% if obj.resource_type %}resource_type=Ref.Resource_Type('{{obj.resource_type}}'){%- endif %}, variable_dict={{var_dict_obj(obj.variable_list)|indent(2)}}, name='{{obj.name}}', default=True, type='{{obj.type}}', {% if obj.editables %}editables = {{obj.editables}}{%- endif %}) | ||
{% else %} | ||
{{obj.var_name}} = dynamic_cred('{{obj.username}}', Ref.Account('{{obj.account}}'), {% if obj.resource_type %}resource_type=Ref.Resource_Type('{{obj.resource_type}}'){%- endif %}, variable_dict={{var_dict_obj(obj.variable_list)|indent(2)}}, name='{{obj.name}}', type='{{obj.type}}', {% if obj.editables %}editables = {{obj.editables}}{%- endif %}) | ||
{% endif %} | ||
{% endmacro %} | ||
|
||
{{ cred(obj) }} |