Documentation ¶
Index ¶
- Variables
- func NewScorecardResource() resource.Resource
- func RuleSchema() map[string]schema.Attribute
- func ScorecardSchema() map[string]schema.Attribute
- type Query
- type Rule
- type ScorecardModel
- type ScorecardResource
- func (r *ScorecardResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *ScorecardResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *ScorecardResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *ScorecardResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *ScorecardResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *ScorecardResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *ScorecardResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *ScorecardResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Constants ¶
This section is empty.
Variables ¶
View Source
var ResourceMarkdownDescription = `
# Scorecard
This resource allows you to manage a scorecard.
See the [Port documentation](https://docs.getport.io/promote-scorecards/) for more information about scorecards.
## Example Usage
Create a parent blueprint with a child blueprint and an aggregation property to count the parent kids:
` + "```hcl" + `
resource "port_blueprint" "microservice" {
title = "microservice"
icon = "Terraform"
identifier = "microservice"
properties = {
string_props = {
"author" = {
title = "Author"
}
"url" = {
title = "URL"
}
}
boolean_props = {
"required" = {
type = "boolean"
}
}
number_props = {
"sum" = {
type = "number"
}
}
}
}
resource "port_scorecard" "readiness" {
identifier = "Readiness"
title = "Readiness"
blueprint = port_blueprint.microservice.identifier
rules = [
{
identifier = "hasOwner"
title = "Has Owner"
level = "Gold"
query = {
combinator = "and"
conditions = [
jsonencode({
property = "$team"
operator = "isNotEmpty"
}),
jsonencode({
property = "author",
operator : "=",
value : "myValue"
})
]
}
},
{
identifier = "hasUrl"
title = "Has URL"
level = "Silver"
query = {
combinator = "and"
conditions = [
jsonencode({
property = "url"
operator = "isNotEmpty"
})
]
}
},
{
identifier = "checkSumIfRequired"
title = "Check Sum If Required"
level = "Bronze"
query = {
combinator = "or"
conditions = [
jsonencode({
property = "required"
operator : "="
value : false
}),
jsonencode({
property = "sum"
operator : ">"
value : 2
})
]
}
}
]
depends_on = [
port_blueprint.microservice
]
}
` + "```"
Functions ¶
func NewScorecardResource ¶
func RuleSchema ¶
func ScorecardSchema ¶
Types ¶
type ScorecardModel ¶
type ScorecardModel struct { ID types.String `tfsdk:"id"` Identifier types.String `tfsdk:"identifier"` Blueprint types.String `tfsdk:"blueprint"` Title types.String `tfsdk:"title"` Rules []Rule `tfsdk:"rules"` CreatedAt types.String `tfsdk:"created_at"` CreatedBy types.String `tfsdk:"created_by"` UpdatedAt types.String `tfsdk:"updated_at"` UpdatedBy types.String `tfsdk:"updated_by"` }
type ScorecardResource ¶
type ScorecardResource struct {
// contains filtered or unexported fields
}
func (*ScorecardResource) Configure ¶
func (r *ScorecardResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*ScorecardResource) Create ¶
func (r *ScorecardResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*ScorecardResource) Delete ¶
func (r *ScorecardResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*ScorecardResource) ImportState ¶
func (r *ScorecardResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
func (*ScorecardResource) Metadata ¶
func (r *ScorecardResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*ScorecardResource) Read ¶
func (r *ScorecardResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*ScorecardResource) Schema ¶
func (r *ScorecardResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (*ScorecardResource) Update ¶
func (r *ScorecardResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
Click to show internal directories.
Click to hide internal directories.