Documentation ¶
Index ¶
- func Provider() terraform.ResourceProvider
- type AccountResponse
- type CertificateAddResponse
- type CertificateEditResponse
- type CertificateListResponse
- type Client
- func (c *Client) AddCertificate(siteID, certificate, privateKey, passphrase string) (*CertificateAddResponse, error)
- func (c *Client) AddDataCenter(siteID, name, serverAddress, isStandby, isContent string) (*DataCenterAddResponse, error)
- func (c *Client) AddDataCenterServer(dcID, serverAddress, isStandby string) (*DataCenterServerAddResponse, error)
- func (c *Client) AddIncapRule(siteID string, rule *IncapRule) (*IncapRuleWithID, error)
- func (c *Client) AddSecurityRuleException(siteID int, ...) (*SecurityRuleExceptionCreateResponse, error)
- func (c *Client) AddSite(domain, accountID, refID, sendSiteSetupEmails, siteIP, forceSSL string) (*SiteAddResponse, error)
- func (c *Client) ConfigureACLSecurityRule(siteID int, ruleID, continents, countries, ips, urls, urlPatterns string) (*SiteStatusResponse, error)
- func (c *Client) ConfigureWAFSecurityRule(siteID int, ...) (*SiteStatusResponse, error)
- func (c *Client) DeleteCertificate(siteID string) error
- func (c *Client) DeleteDataCenter(dcID string) error
- func (c *Client) DeleteDataCenterServer(serverID string) error
- func (c *Client) DeleteIncapRule(siteID string, ruleID int) error
- func (c *Client) DeleteSecurityRuleException(siteID int, ruleID, whitelistID string) error
- func (c *Client) DeleteSite(domain string, siteID int) error
- func (c *Client) EditCertificate(siteID, certificate, privateKey, passphrase string) (*CertificateEditResponse, error)
- func (c *Client) EditDataCenter(dcID, name, isStandby, isContent, isEnabled string) (*DataCenterEditResponse, error)
- func (c *Client) EditDataCenterServer(serverID, serverAddress, isStandby, isEnabled string) (*DataCenterServerEditResponse, error)
- func (c *Client) EditSecurityRuleException(siteID int, ...) (*SiteStatusResponse, error)
- func (c *Client) ListCertificates(siteID string) (*CertificateListResponse, error)
- func (c *Client) ListDataCenters(siteID string) (*DataCenterListResponse, error)
- func (c *Client) ListSecurityRuleExceptions(siteID, ruleID string) (*SiteStatusResponse, error)
- func (c *Client) ReadIncapRule(siteID string, ruleID int) (*IncapRuleWithID, int, error)
- func (c *Client) SiteStatus(domain string, siteID int) (*SiteStatusResponse, error)
- func (c *Client) UpdateIncapRule(siteID string, ruleID int, rule *IncapRule) (*IncapRuleWithID, error)
- func (c *Client) UpdateSite(siteID, param, value string) (*SiteUpdateResponse, error)
- func (c *Client) Verify() (*AccountResponse, error)
- type Config
- type DataCenterAddResponse
- type DataCenterEditResponse
- type DataCenterListResponse
- type DataCenterServerAddResponse
- type DataCenterServerEditResponse
- type DeleteSecurityRuleExceptionResponse
- type IncapRule
- type IncapRuleWithID
- type SecurityRuleExceptionCreateResponse
- type SiteAddResponse
- type SiteStatusResponse
- type SiteUpdateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Provider ¶
func Provider() terraform.ResourceProvider
Provider returns a terraform.ResourceProvider
Types ¶
type AccountResponse ¶
type AccountResponse struct { Account struct { Email string `json:"email"` PlanID string `json:"plan_id"` PlanName string `json:"plan_name"` TrialEndDate string `json:"trial_end_date"` AccountID int `json:"account_id"` RefID string `json:"ref_id"` UserName string `json:"user_name"` AccountName string `json:"account_name"` Logins []struct { LoginID float64 `json:"login_id"` Email string `json:"email"` EmailVerified bool `json:"email_verified"` } `json:"logins"` SupportLevel string `json:"support_level"` SupportAllTLSVersions bool `json:"supprt_all_tls_versions"` WildcardSANForNewSites string `json:"wildcard_san_for_new_sites"` NakedDomainSANForNewWWWSites bool `json:"naked_domain_san_for_new_www_sites"` } `json:"account"` Email string `json:"email"` PlanID string `json:"plan_id"` PlanName string `json:"plan_name"` AccountID int `json:"account_id"` UserName string `json:"user_name"` AccountName string `json:"account_name"` RefID string `json:"ref_id"` Logins []struct { LoginID float64 `json:"login_id"` Email string `json:"email"` EmailVerified bool `json:"email_verified"` } `json:"logins"` SupportLevel string `json:"support_level"` SupportAllTLSVersions bool `json:"supprt_all_tls_versions"` WildcardSANForNewSites string `json:"wildcard_san_for_new_sites"` NakedDomainSANForNewWWWSites bool `json:"naked_domain_san_for_new_www_sites"` Res int `json:"res"` ResMessage string `json:"res_message"` DebugInfo struct { IDInfo string `json:"id-info"` } `json:"debug_info"` }
AccountResponse contains account id
type CertificateAddResponse ¶
CertificateAddResponse contains confirmation of successful upload of certificate
type CertificateEditResponse ¶
CertificateEditResponse contains confirmation of successful upload of certificate
type CertificateListResponse ¶
type CertificateListResponse struct {
Res int `json:"res"`
}
CertificateListResponse contains site object with details of custom certificate
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an internal client that brokers calls to the Incapsula API
func (*Client) AddCertificate ¶
func (c *Client) AddCertificate(siteID, certificate, privateKey, passphrase string) (*CertificateAddResponse, error)
AddCertificate adds a custom SSL certificate to a site in Incapsula
func (*Client) AddDataCenter ¶
func (c *Client) AddDataCenter(siteID, name, serverAddress, isStandby, isContent string) (*DataCenterAddResponse, error)
AddDataCenter adds an incap rule to be managed by Incapsula
func (*Client) AddDataCenterServer ¶
func (c *Client) AddDataCenterServer(dcID, serverAddress, isStandby string) (*DataCenterServerAddResponse, error)
AddDataCenterServer adds an incap data center server to be managed by Incapsula
func (*Client) AddIncapRule ¶
func (c *Client) AddIncapRule(siteID string, rule *IncapRule) (*IncapRuleWithID, error)
AddIncapRule adds an incap rule to be managed by Incapsula
func (*Client) AddSecurityRuleException ¶
func (c *Client) AddSecurityRuleException(siteID int, ruleID, clientAppTypes, clientApps, countries, continents, ips, urlPatterns, urls, userAgents, parameters string) (*SecurityRuleExceptionCreateResponse, error)
AddSecurityRuleException adds a security rule exception
func (*Client) AddSite ¶
func (c *Client) AddSite(domain, accountID, refID, sendSiteSetupEmails, siteIP, forceSSL string) (*SiteAddResponse, error)
AddSite adds a site to be managed by Incapsula
func (*Client) ConfigureACLSecurityRule ¶
func (c *Client) ConfigureACLSecurityRule(siteID int, ruleID, continents, countries, ips, urls, urlPatterns string) (*SiteStatusResponse, error)
ConfigureACLSecurityRule adds an ACL rule
func (*Client) ConfigureWAFSecurityRule ¶
func (c *Client) ConfigureWAFSecurityRule(siteID int, ruleID, securityRuleAction, activationMode, ddosTrafficThreshold, blockBadBots, challengeSuspectedBots string) (*SiteStatusResponse, error)
ConfigureWAFSecurityRule adds an WAF rule
func (*Client) DeleteCertificate ¶
DeleteCertificate deletes a custom certificate for a specific site in Incapsula
func (*Client) DeleteDataCenter ¶
DeleteDataCenter deletes a site currently managed by Incapsula
func (*Client) DeleteDataCenterServer ¶
DeleteDataCenterServer deletes a data center server currently managed by Incapsula
func (*Client) DeleteIncapRule ¶
DeleteIncapRule deletes a site currently managed by Incapsula
func (*Client) DeleteSecurityRuleException ¶
DeleteSecurityRuleException deletes a security rule exception
func (*Client) DeleteSite ¶
DeleteSite deletes a site currently managed by Incapsula
func (*Client) EditCertificate ¶
func (c *Client) EditCertificate(siteID, certificate, privateKey, passphrase string) (*CertificateEditResponse, error)
EditCertificate updates the custom certifiacte on an Incapsula site
func (*Client) EditDataCenter ¶
func (c *Client) EditDataCenter(dcID, name, isStandby, isContent, isEnabled string) (*DataCenterEditResponse, error)
EditDataCenter edits the Incapsula incap rule
func (*Client) EditDataCenterServer ¶
func (c *Client) EditDataCenterServer(serverID, serverAddress, isStandby, isEnabled string) (*DataCenterServerEditResponse, error)
EditDataCenterServer edits the Incapsula data center server
func (*Client) EditSecurityRuleException ¶
func (c *Client) EditSecurityRuleException(siteID int, ruleID, clientAppTypes, clientApps, countries, continents, ips, urlPatterns, urls, userAgents, parameters, whitelistID string) (*SiteStatusResponse, error)
EditSecurityRuleException edits a security rule exception
func (*Client) ListCertificates ¶
func (c *Client) ListCertificates(siteID string) (*CertificateListResponse, error)
ListCertificates gets the list of custom certificates for a site
func (*Client) ListDataCenters ¶
func (c *Client) ListDataCenters(siteID string) (*DataCenterListResponse, error)
ListDataCenters gets the Incapsula list of data centers
func (*Client) ListSecurityRuleExceptions ¶
func (c *Client) ListSecurityRuleExceptions(siteID, ruleID string) (*SiteStatusResponse, error)
ListSecurityRuleExceptions gets the site status including the list of exceptions for security rules
func (*Client) ReadIncapRule ¶
ReadIncapRule gets the specific Incap Rule
func (*Client) SiteStatus ¶
func (c *Client) SiteStatus(domain string, siteID int) (*SiteStatusResponse, error)
SiteStatus gets the Incapsula managed site's status
func (*Client) UpdateIncapRule ¶
func (c *Client) UpdateIncapRule(siteID string, ruleID int, rule *IncapRule) (*IncapRuleWithID, error)
UpdateIncapRule updates the Incapsula Incap Rule
func (*Client) UpdateSite ¶
func (c *Client) UpdateSite(siteID, param, value string) (*SiteUpdateResponse, error)
UpdateSite will update the specific param/value on the site resource
func (*Client) Verify ¶
func (c *Client) Verify() (*AccountResponse, error)
Verify checks the API credentials
type Config ¶
type Config struct { // API Identifier APIID string // API Key APIKey string // Base URL (no trailing slash) BaseURL string // IncapRule Base URL (no trailing slash) IncapRuleBaseURL string }
Config represents the configuration required for the Incapsula Client
type DataCenterAddResponse ¶
type DataCenterAddResponse struct { Res interface{} `json:"res"` DataCenterID string `json:"datacenter_id"` }
DataCenterAddResponse contains id of data center
type DataCenterEditResponse ¶
type DataCenterEditResponse struct { Res interface{} `json:"res"` ResMessage string `json:"res_message"` }
DataCenterEditResponse contains edit response message
type DataCenterListResponse ¶
type DataCenterListResponse struct { Res interface{} `json:"res"` DCs []struct { ID string `json:"id"` Enabled string `json:"enabled"` Servers []struct { ID string `json:"id"` Enabled string `json:"enabled"` Address string `json:"address"` IsStandBy string `json:"isStandby"` } `json:"servers"` Name string `json:"name"` ContentOnly string `json:"contentOnly"` IsActive string `json:"isActive"` } `json:"DCs"` }
DataCenterListResponse contains list of data centers and servers
type DataCenterServerAddResponse ¶
type DataCenterServerAddResponse struct { Res interface{} `json:"res"` ServerID string `json:"server_id"` }
DataCenterServerAddResponse contains id of server
type DataCenterServerEditResponse ¶
type DataCenterServerEditResponse struct { Res interface{} `json:"res"` DataCenterID string `json:"datacenter_id"` }
DataCenterServerEditResponse contains data center id
type DeleteSecurityRuleExceptionResponse ¶
type DeleteSecurityRuleExceptionResponse struct {
Res int `json:"res"`
}
DeleteSecurityRuleExceptionResponse contains the response code for deleting a security exception
type IncapRule ¶
type IncapRule struct { Name string `json:"name"` Action string `json:"action"` Filter string `json:"filter"` ResponseCode int `json:"response_code,omitempty"` AddMissing bool `json:"add_missing,omitempty"` From string `json:"from,omitempty"` To string `json:"to,omitempty"` RewriteName string `json:"rewrite_name,omitempty"` DCID int `json:"dc_id,omitempty"` RateContext string `json:"rate_context,omitempty"` RateInterval int `json:"rate_interval,omitempty"` ErrorType string `json:"error_type,omitempty"` ErrorResponseFormat string `json:"error_response_format,omitempty"` ErrorResponseData string `json:"error_response_data,omitempty"` }
IncapRule is a struct that encompasses all the properties of an IncapRule
type IncapRuleWithID ¶
IncapRuleWithID contains the IncapRule as well as the rule identifier
type SecurityRuleExceptionCreateResponse ¶
type SecurityRuleExceptionCreateResponse struct { Res string `json:"res"` ExceptionID string `json:"exception_id"` Status string `json:"status"` }
SecurityRuleExceptionCreateResponse provides exception_id of rule exception
type SiteAddResponse ¶
SiteAddResponse contains the relevant site information when adding an Incapsula managed site
type SiteStatusResponse ¶
type SiteStatusResponse struct { SiteID int `json:"site_id"` Status string `json:"status"` Domain string `json:"domain"` RefID string `json:"ref_id,omitempty"` AccountID int `json:"account_id"` AccelerationLevel string `json:"acceleration_level"` SiteCreationDate int64 `json:"site_creation_date"` Ips []string `json:"ips"` DNS []struct { DNSRecordName string `json:"dns_record_name"` SetTypeTo string `json:"set_type_to"` SetDataTo []string `json:"set_data_to"` } `json:"dns"` OriginalDNS []struct { DNSRecordName string `json:"dns_record_name"` SetTypeTo string `json:"set_type_to"` SetDataTo []string `json:"set_data_to"` } `json:"original_dns"` Warnings []interface{} `json:"warnings"` Active string `json:"active"` SupportAllTLSVersions bool `json:"support_all_tls_versions"` WildcardSanForNewSites bool `json:"wildcard_san_for_new_sites"` NakedDomainSanForNewWwwSites bool `json:"naked_domain_san_for_new_www_sites"` AdditionalErrors []interface{} `json:"additionalErrors"` DisplayName string `json:"display_name"` Security struct { Waf struct { Rules []struct { Action string `json:"action,omitempty"` ActionText string `json:"action_text,omitempty"` ID string `json:"id"` Name string `json:"name"` BlockBadBots bool `json:"block_bad_bots,omitempty"` ChallengeSuspectedBots bool `json:"challenge_suspected_bots,omitempty"` ActivationMode string `json:"activation_mode,omitempty"` ActivationModeText string `json:"activation_mode_text,omitempty"` DdosTrafficThreshold int `json:"ddos_traffic_threshold,omitempty"` Exceptions []struct { Values []struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` Ips []string `json:"ips,omitempty"` Urls []struct { Value string `json:"value,omitempty"` Pattern string `json:"pattern,omitempty"` } `json:"urls,omitempty"` Geo struct { Countries []string `json:"countries,omitempty"` Continents []string `json:"continents,omitempty"` } `json:"geo,omitempty"` ClientApps []string `json:"client_apps,omitempty"` ClientAppTypes []string `json:"client_app_types,omitempty"` Parameters []string `json:"parameters,omitempty"` UserAgents []string `json:"user_agents,omitempty"` } `json:"values,omitempty"` ID int `json:"id,omitempty"` } `json:"exceptions,omitempty"` } `json:"rules"` } `json:"waf"` Acls struct { Rules []struct { Ips []string `json:"ips,omitempty"` ID string `json:"id"` Name string `json:"name"` Geo struct { Countries []string `json:"countries"` Continents []string `json:"continents"` } `json:"geo,omitempty"` Urls []struct { Value string `json:"value"` Pattern string `json:"pattern"` } `json:"urls,omitempty"` Exceptions []struct { Values []struct { ID string `json:"id"` Name string `json:"name"` Ips []string `json:"ips,omitempty"` Urls []struct { Value string `json:"value"` Pattern string `json:"pattern"` } `json:"urls,omitempty"` Geo struct { Countries []string `json:"countries"` Continents []string `json:"continents"` } `json:"geo,omitempty"` ClientApps []string `json:"client_apps,omitempty"` ClientAppTypes []string `json:"client_app_types,omitempty"` Parameters []string `json:"parameters,omitempty"` UserAgents []string `json:"user_agents,omitempty"` } `json:"values"` ID int `json:"id"` } `json:"exceptions"` } `json:"rules"` } `json:"acls"` } `json:"security"` SealLocation struct { ID string `json:"id"` Name string `json:"name"` } `json:"sealLocation"` Ssl struct { OriginServer struct { Detected bool `json:"detected"` DetectionStatus string `json:"detectionStatus"` } `json:"origin_server"` GeneratedCertificate struct { San []interface{} `json:"san"` } `json:"generated_certificate"` } `json:"ssl"` SiteDualFactorSettings struct { SpecificUsers []interface{} `json:"specificUsers"` Enabled bool `json:"enabled"` CustomAreas []interface{} `json:"customAreas"` CustomAreasExceptions []interface{} `json:"customAreasExceptions"` AllowAllUsers bool `json:"allowAllUsers"` ShouldSuggestApplicatons bool `json:"shouldSuggestApplicatons"` AllowedMedia []string `json:"allowedMedia"` ShouldSendLoginNotifications bool `json:"shouldSendLoginNotifications"` Version int `json:"version"` } `json:"siteDualFactorSettings"` LoginProtect struct { Enabled bool `json:"enabled"` SpecificUsersList []interface{} `json:"specific_users_list"` SendLpNotifications bool `json:"send_lp_notifications"` AllowAllUsers bool `json:"allow_all_users"` AuthenticationMethods []string `json:"authentication_methods"` Urls []interface{} `json:"urls"` URLPatterns []interface{} `json:"url_patterns"` } `json:"login_protect"` PerformanceConfiguration struct { AdvancedCachingRules struct { NeverCacheResources []interface{} `json:"never_cache_resources"` AlwaysCacheResources []interface{} `json:"always_cache_resources"` } `json:"advanced_caching_rules"` AccelerationLevel string `json:"acceleration_level"` AsyncValidation bool `json:"async_validation"` MinifyJavascript bool `json:"minify_javascript"` MinifyCSS bool `json:"minify_css"` MinifyStaticHTML bool `json:"minify_static_html"` CompressJpeg bool `json:"compress_jpeg"` CompressJepg bool `json:"compress_jepg"` ProgressiveImageRendering bool `json:"progressive_image_rendering"` AggressiveCompression bool `json:"aggressive_compression"` CompressPng bool `json:"compress_png"` OnTheFlyCompression bool `json:"on_the_fly_compression"` TCPPrePooling bool `json:"tcp_pre_pooling"` ComplyNoCache bool `json:"comply_no_cache"` ComplyVary bool `json:"comply_vary"` UseShortestCaching bool `json:"use_shortest_caching"` PerferLastModified bool `json:"perfer_last_modified"` PreferLastModified bool `json:"prefer_last_modified"` DisableClientSideCaching bool `json:"disable_client_side_caching"` Cache300X bool `json:"cache300x"` CacheHeaders []interface{} `json:"cache_headers"` } `json:"performance_configuration"` ExtendedDdos int `json:"extended_ddos"` ExceptionID string `json:"exception_id,omitempty"` Res interface{} `json:"res"` ResMessage string `json:"res_message"` DebugInfo struct { IDInfo string `json:"id-info"` } `json:"debug_info"` }
SiteStatusResponse contains managed site information
type SiteUpdateResponse ¶
SiteUpdateResponse contains the relevant site information when updating an Incapsula managed site
Source Files ¶
- client_account.go
- client_acl_security_rule.go
- client_certificate.go
- client_data_center.go
- client_data_center_server.go
- client_incap_rule.go
- client_security_rule_exception.go
- client_site.go
- client_waf_security_rule.go
- config.go
- diff_suppress_funcs.go
- provider.go
- resource_acl_security_rule.go
- resource_certificate.go
- resource_data_center.go
- resource_data_center_server.go
- resource_incap_rule.go
- resource_security_rule_exception.go
- resource_site.go
- resource_waf_security_rule.go